I posted this in a movies sub and a few Redditors mentioned video games.
GTA V has Trevor kill Johnny from the previous game early on
The Last of Us Part 2 (which I haven’t played) kills off Joel at the start
Honorable mention: Mass Effect 2 has Commander Shepard die at the beginning but he’s instantly resurrected
What other games do this?
This kind of obscure since I don’t think this game, while well known, is well known for any particular story or characters, but Joe Ramirez is killed off at the very beginning of Ghost Recon Future Soldier.
In Gears of War 3 Prescott is killed in the first act of the game.
In Halo 5 the main antagonist of Spartan Ops is killed in a cutscene in the first mission, and in Halo Infinite several main characters are killed offscreen before the game begins.