When you die, a gravestone is put where you died. If you are underwater, it will place it on the closest air block above you.
This mod especially works well with Xaero's Minimap because gravestones save your items, and the stated mod saves your death location and puts a waypoint where you died.
There is no chance of losing your items upon death. (Exception: Bug 001 In Recognized Bugs) To get your items back, simply break the grave. The grave saves your item slot data as well, so the items and armor will go back to the same spot they were in before you died.
If you have a full inventory when you break the grave, the items will go everywhere like breaking a storage block.