How to absolutely wreck your audience with a character death:
Let the character have plenty of screen time before the death. Show us their motivations, dreams, and inner world, so we really connect with them.
Kill them towards the latter half of the middle of your story, instead of the end, so we get to see the proper grief and how the death has affected the other characters.
Kill them off while their at their highest, or when things are just starting to look up for them.
Alternatively, kill them in the middle of their character arc, as they’re about to change for better.
For the actual death themselves, killing via betrayal from something they trusted- be it equipment failure, or a person, or killing them of something that could’ve been easily preventable, often hit the hardest.
Show other characters grief over them. Show how they’ve been absolutely wrecked over the loss of this character.
Continue to show sides of the character even after death. Have other characters find out information about them that makes the audience wish they could explore the dead character further.
Let the dead character have an ambition/goal/dream they were super passionate about that they never got to complete.
Cause an argument/conflict between the dead character and another character right before the character dies.
Have the remaining cast face challenges that could’ve been easily resolved if the dead character was there.
Kill main cast characters sparingly. A few meaningful character deaths are a lot more tear jerking than a blood bath.
If you want to be really, really cruel, and your writing in a point of view that would allow you to do this, reveal important information about the death to the audience, but not to the characters.
If your writing in a genre were it would be possible, consider having the dead character know that they’re going to die, but not revealing it to the others.
Have their death be in vain to the main goal. Instead of a heroic sacrifice, it was a cruel casualty.