Dig a hole in the side of a cliff or hill. Make it at least 3 blocks deep. Then go inside the hole. You can keep digging as far as you can, if you want, but try to get at least 7 or 8 blocks in from the entrance (to hide from creepers).
But when you see the sun start to set, fill in your entrance. If it is at least 3 blocks high and you are a good distance off the ground (8+ blocks) then you can leave a one-block window. Otherwise, it is safer to wait until night is over (you can wait 8 minutes clock time). If you don't have a window, mine one of your blocks every now and then, and check if it is still night.
If it is, fill it back in and repeat. To pass time, you could try extend your makeshift shelter but make sure you don't hit a cave or make any openings. Avoid jumping, which spends your hunger quickly, or craft stairs to preserve your energy if you are digging down or up. If it is daytime, then congratulations: You have survived your first night.