There are two different ways to play Minecraft. 1) Creative and 2) Survival.
In Creative mode you have the ability to fly, you can't die, and you have access to an unlimited number of every single block and item in the game.
Survival mode on the other hand you have 10 hearts of health or 20 hitpoints, 10 hunger notches or 20 hunger points, an experience bar, 9 hot bar slots as well as 27 inventory slots, 4 crafting slots, and 4 armour slots.
In survival Minecraft there are four difficulties Peaceful, Easy, Normal, and Hard. On Peaceful difficulty no hostile mobs will spaw. But on Easy through Hard difficulty hostile mobs will spawn at night time or in areas with low or no light. Your goal as the player is to builed a shelter/base to hide from the hostile mobs. Or you can make a weapon and fight through the night. In survival Minecraft you also have to create a stable food source as to keep your avatar from starving to death. It is also important to keep your Hunger Bar full because if your Hunger Bar is missing 2 or more Hunger Notches you will not be able to regen health.