Players will take damage from a number of things in Minecraft. To avoid dying, you’ll have to build it back up.
The easiest way to do this is by eating food. Eating Sweet Berries or Apples you find in forests and the like will heal you, though not very much.
Once you have a house and a base set up, you’ll want to create a farm to grow Wheat. Wheat can be crafted into Bread, which is a useful and simple way to keep your health up. Wheat seeds can be found from smashing wild shrubs.
To farm, you’ll need to use a Hoe (two sticks and two Planks, Cobblestone, Blackstone, or Ingots) on dirt or grass blocks to turn it into farmland. Plant your seeds on the farmland and it’ll yield produce, as well as more seeds. You’ll need water within four blocks of the crop horizontally or else your crops will dry out.
You can also cook caught Salmon and Cod in the Furnace to make cooked fish, which will also heal you. A Fishing Rod can be made using three Sticks and two String. Keep in mind that eating food will make you regain your health, but it will happen over the span of a few seconds, not instantly.
Note that if you get too hungry, indicated by the small meat icons above your toolbar, you’ll start taking damage. If you have nine or more meat icons, you’ll also passively regenerate health, so it’s important to keep yourself fed.
For instant health regeneration, you’ll need to use a Potion of Healing, which requires using a Brewing Stand. You can make a Brewing Stand using one Blaze Rod (dropped from Blazes in Nether Fortresses) and three Cobblestone or Blackstone. Because of the materials required for potion brewing, players just starting out in a new world should use food until they have access to the resources required for potions.