You need to build up the tension before the death. Make the reader care about the character. And describe the moment of death vividly but not too graphically.
Well, to write a compelling death scene, you need to build up the emotion. Make the reader care about the character before their demise. Also, describe the details vividly to make it feel real.