How do I make a death counter for my parkour map using a datapack?

Im trying to make a death counter and cant figure out how to register if a player dies. I am new to datapacks and just learning the basics.

Continue to help post