This article assumes you have a basic knowledge of Minecraft. See the "The Basics" article if you don't. You can easily die on your first night if you don't have a shelter setup when night falls.
When picking the place you will spend your first night you should make sure the spot you pick is close to where you spawned. If you die then you won't have far to get back to your shelter. Your first shelter does not need to be in the place you finaly wish to settle, its just a place to shelter from enemy Mobs.Its best to either pick a location which is high up or that is surrounded by Water on all sides. Height gives you the advantage that not meny Mobs are likley to spawn near your shelter and if they do, most shouldn't be able to reach you. Water gives you the advantage that Mobs can't spawn on the Water its self. Water also allows you to jump off the top of your shelter into it without damaging yourself (Allowing you to escape any Mobs that find you). Water has the disadvantage that Skeletons and Zombies won't be set on Fire by the sun if they are standing in Water.
Once you have found a location you need to gather materials to build your shelter. If there are Trees near by you could gather Logs but for a tempary shelter Dirt will do fine. You need to build the shelter quickley before the sun goes down so you should make it Small, about 5x5 blocks wide and at least 2 Blocks tall. There is no need to build a Roof. Once you have built your shelter you should gather Logs if there is still time. Logs are the most basic material needed for Crafting.
When the Sun goes down
When the Sun starts to go down and the world gets darker head straight for your shelter. Use Blocks to block the enterance to your shelter. Now you just need to wait.
When the Sun comes out again Skeletons and Zombies should start to go on Fire and die(The Sun needs to brighten the world enough before they set on Fire). Creepers and Spiders will not die due to sunlight. Its advisable to place a block inside your shelter so that you can get ontop of it and see if there are any Mobs near you. If there are your best bet is to drop down a side of your shelter where there arn't any Mobs and run from them. Once you get far enough away the Mobs will disapear allowing you to go back to your shelter.Congratulations, you have survived your first night.