The biggest MCU films, Avengers: Infinity War and Avengers: Endgame, killed a number of beloved heroes but did so in ways that serviced the story.
There are absolutely exceptions, but these exceptions are worked into the plot in clever ways and don’t for a second feel contrived (which is impressive considering how many character fates changed during the writing process).
As the MCU has darkened and matured, it has become bolder and more liberal with its character deaths.
Gone are the “gotcha” moments of films such as Captain America: The Winter Soldier and Thor: The Dark World.