Updated to 1.20
You may want to have a Death Counter for many reasons in Minecraft, usually it is necessary in some PvP servers. There are a couple of different ways to add a Death Counter, so we are going to see them all.

How to add a Death Counter – mods
The first way to add a Death Counter is through installing mods or addons. There are many available mods that can give you a Death Counter, so you need to find one that is not too old or that is regularly updated.
You can find here a mod for Java that is updated to the current version of the game.
And you can find here one addon for the Bedrock edition. Even if it was developed for an older version of the game it still works with the current version of the game.
How to add a Death Counter – commands
To use commands you will need to have cheats allowed in your Minecraft world. If cheats are not allowed in your world, there is a workaround. You can check here how to still use cheats in that Minecraft world. If you want to use commands in a server you will need to be an OP (Wanna start your FREE Minecraft server? Check the article IS ATERNOS safe?).
The first thing that you need to do is create an objective. To do so, open the commands and type:
/scoreboard objectives add Death_Counter deathCount
Death_Counter is the name that we are giving to the objective. This is the name that will be shown later on, so you can change it to whatever you prefer (Deaths, Death times, number of deaths etc.). The game will say Created new objective [Death_Counter]

Now, to be able to see this objective, you will need to type:
/scoreboard objectives setdisplay list Death_Counter
Now if you press TAB you will be able to see the Death Counter on the top of the screen.

If you want the Death Counter to always show (without the need to press TAB), you can use the following command:
/scoreboard objectives setdisplay sidebar Death_Counter
Now you will see the Death Counter of all the players on the right side of the screen (in the screenshot below there is only one name since it was taken in a singleplayer world).

If you want to reset the counter of a specific player (or change it to whatever number), you can use the following command (change Jack with the name of that player):
/scoreboard players set Jack Death_Counter 0
And if you don’t want to see the Death Counter anymore, you can use the following command:
/scoreboard objectives remove Death_Counter
How to add a Death Counter – commands for Bedrock
If you are playing the Bedrock edition, the process will be more or less the same. You just need to do the following substitution in the first of the commands seen in the paragraph above:
/scoreboard objectives add deathCount Death_Counter
instead of
/scoreboard objectives add Death_Counter deathCount
Conclusions
There are two ways to add a Death Counter in Minecraft: by using mods/addons or by using commands. If you want to do it with commands you will need to create and then show an objective by using the scoreboard command. Thank you very much for reading the article this far and I hope I’ll see you again around here. See you and take care!