How do you kill a character without playing it for shock value?

I ran into this problem with a major character in a story I'm writing. I knew I wanted to kill him off, but I didn't want it to feel like I was just checking off a box that said "character X dies in the final battle".

What I decided to do was make it his choice. I don't mean suicide, but simply that he recognized the danger of his actions before taking them. He weighed his options and decided that it was worth risking his life to face that danger, in order to save someone else. Sure, things could have worked out just fine, but the stakes were high and death was possible. I just didn't want it to feel like some random cheap shot when it finally happened.

/r/writing Thread