CJ from the Dawn of the Dead remake is pretty much the archetype for this one for me. Introduced as a dickhead character. Slowly becomes socialised and more important to the group of survivors and then becomes more and more of a badass as the film concludes and then goes out in a heroic way.
Also Shea Wigham’s character in Kong: Skull Island, because of the world weary way in which he decides to sacrifice himself to attempt to save his friends.
Does Sunshine count? Chris Evans climbing into the freezing cold cooling tank thing to repair the ship as it makes its approach to the sun, then getting stuck, and dying after he’s finished doing his thing. On each rewatch I find it very upsetting!