How do I check when a player dies then run a command as the player that died

title, version 1.21.4
Continue to help post