Finding the Rules
You might think this would be under Healing in the Combat section of the freely-available Basic Rules, but actually it's under Resting in the Adventuring section.
Specifically, under Short Rest, there is:
A character can spend one or more Hit Dice at the end of a short rest, up to the character's maximum number of Hit Dice, which is equal to the character's level. For each Hit Die spent in this way, the player rolls the die and adds the character's Constitution modifier to it. The character regains hit points equal to the total. The player can decide to spend an additional Hit Die after each roll. A character regains some spent Hit Dice upon finishing a long rest, as explained below.
and under Long Rest:
At the end of a long rest, a character regains all lost hit points. The character also regains spent Hit Dice, up to a number of dice equal to half of the character's total number of them (minimum of one die).
What Does It All Mean?
Every time you gain a level, you get an additional "Hit Die", so if you are 1st level, you have one Hit Die, and if you are 3rd level, you have three Hit Dice, and if you are 20th level, you have twenty. The "size" of each die varies by class — "tough" classes like Barbarian get d12s, while Wizards and Sorcerers get d6s.
These hit dice are both rolled once as you level up to determine your increase in maximum hit points¹, and become a pool you can use for healing throughout the adventuring day.
To use a Hit Die, you "spend" it — you roll it and add the result plus your Con modifier to your current HP². Once you've spent a die from your pool, you can't use it again until you've "regained" it — which happens when you take a long rest.
If you've multiclassed, you may have a mix of different die sizes: a fighter/wizard will have both d10s and d6s. You can choose to spend in any order, and you also to regain in any order.
A Little Extemporizing On Design
Why all this complication? Why not just a bunch of hit points? It helps make each individual battle interesting and challenging. The characters' maximum hit points can be at a level where a single difficult fight can knock them down to zero if things go badly, but yet the party can confidently deal with multiple encounters per day.
In editions with just one big pool, DMs can feel that in order to provide a challenge, they need to do a grueling series of battles without rest to wear down party resources — and players have the opposite impulse, to push for a ten-minute adventuring day. This mechanic reduces both of those pressures.
1. Or you can take a fixed value when you level up, to reduce the risk of rolling a 1.
2. You can't take a fixed value when "spending" die from the pool to regain lost hit points. At least, not without a house rule.