Well, nature is your best friend. Therefore, if you get lost and need shelter, the first thing to do is search for a natural shelter (like a cave or something) and then start looking for food and considering how to get warm (or cool depending on the situation).
All in all, the first step is to start searching for for natural shelter.