I wouldn't just straight away start digging.. I'd go search not too far from spawn to find exposed coal in the side of a hill/exposed cave and craft torches with that coal. You can dig the stone around the coal for enough stone to craft a pickaxe to mine it. That alone leaves you with roughly 2 minutes to build a shelter. If I were you I'd simple dig a 3 deep hole and patch the top so no mobs can fall in and come back up after 5 minutes. In the mean time you can craft some tools/planks out of the items you harvested. Then start punching trees 'till you drop and stay in a hole again. (By this point you could also craft a chest to keep items in if you wanted) THEN you will have enough time to build a nice house out of the materials you crafted in the hole while you were waiting out the night.