A character begins the game with one hit point.
Each time they gain a hit dice, they gain one max hit point.
A full days rest recovers one hit point.
When struck (an opponent successfully rolls to hit them, overcoming their armour class) the attacker rolls damage, the defender then rolls their hit dice repeatedly (adding their constition modifier to hit points each time) until the sum of the rolled values exceeds the amount of damage they have taken, the defender then loses one hit point for each dice rolled except for the dice that took them to a value greater than the damage dealt.
As an example, a great Halfling hero has found themselves face to face with the god Nerull. Nerull swings his scythe and strikes the halfling, he expertly passes his save versus death with the luck of a halfling, so only takes the weapons mighty 5d6 damage… 2+1+4+6+3=16. Nerulls scythe is a +5 weapon, so this deals 21 total damage to the poor halfling. Halflings possess a d6 hit dice, and this hero is powerful enough to have a +1 modifier to their hit points from their constitution. They begin rolling:
Their first four rolls brings their total to 18, which is not enough to surpass the 21 damage dealt. The final roll brings the value to 25, surpassing Nerulls scythe and allowing the halfling to surive. Four of their dice did not surpass the damage, and thus they lose four HP.
Our brave hero was only level 7, and took 2 hit points of damage on the way here. They now have only one hit point remaining (7-2-4=1). Extremely out of their depth, it’s clearly time for them to try and find a way out of Tartarus and flee the god of death.