How do you write a sad character death?
The best example of what I'm going for is like Doc Ock's sacrifice in the second spider man movie.
Here's a synapsis: The OC/fan character ends up getting turned into a mutant monster and has to fight his friends/the protagonists. And by the end of the fight, he sacrifices himself so the others get away.
I just want to write a character where people can bond to and love and then have the most heartbreaking, heart-wrenching character death so it can be sad. Because I want the point of this character to have a sad end.
Any help with it?