Perhaps you have had the experience of hiking with friends and you fall too far behind. You’re far enough behind that you walk and walk but you aren’t catching up. You might, for a panicked moment, think that you’re lost, but then you turn a corner and phew there they are, wondering what was taking you so long.

But what happens when you don’t catch up? What happens when you take the wrong fork in the trail, or get distracted and find yourself not on a trail at all? The best way to survive getting lost is to come prepared in the first place. Make sure you bring the essential items, that you know how to use them, and that you notify someone else of your hiking plans.

When you do get lost, though, stick to these three major steps and you will increase your chances of finding your way back or getting rescued.

Stop and assess

Don’t continue to walk in circles pulling your hair out. Stop, take a deep breath, and assess your surroundings. What can you see? Can you glimpse any clearings in the trees where the trail might be?

Think back to when you might have strayed off track. How long ago was it? Ten minutes? Half an hour? More? This can indicate to you just how far off the trail you are, and you can try turning and walking back the way you came.

Take inventory of the things you have with you. If you brought items like a map and compass, you can use these to get a bearing on your location and walk towards the major landmarks on the map. According to adventure writer Mark Jenkins, these two objects are the most crucial to survival if you get lost. See his article in The Guardian for more necessary hiking items, and how to be most prepared for the unexpected.

If you do not have a compass and a map, and if retracing your steps doesn’t produce results, it’s a good idea to simply stay put. Unless you feel a high degree of certainty about which direction to walk in, staying where you are is always recommended so that searchers have an easier time finding you. You can still do little things to help your situation, even if you do have to stay in one place.

Make yourself visible

Use all of the possible tools at your disposal to make it easier for people to find you. Do you have a brightly colored shirt in your backpack? Try displaying it on a tree branch where it can easily be spotted. If you have a metal water bottle or a mirror you can use them to reflect light and catch a distant hiker’s eye. Be creative and use whatever you have with you.

Another option is creating a fire. Only do this if you are confident you will be able to keep the fire contained, as you don’t want to start a wildfire. Even a small, makeshift fire can produce smoke that will rise above the trees and indicate your location to anyone who is looking for you.

Think ahead and prepare

Sure, you probably won’t be stuck out there until nightfall, but you never know. It’s good to think ahead to the worst possible scenario and try to guard against any potentially dangerous situations.

For example, you don’t want to be caught in the dark without some kind of shelter. Think about how long you have until the sun goes down, and look around for a potential place to sleep. This will allow you to form a plan for the daylight hours you have left. You can continue searching for the path or creating ways to be seen, but an hour before sunset you should stop whatever it is you’re doing and focus on creating a decent spot to stay the night. This could be up against some boulders, beneath a large tree, or tucked away under some bushes. Anything is better than being completely out in the open.

From the moment you know you are lost, you should ration your water and food intake. It’s likely you have a water bottle and maybe a granola bar with you, but you don’t want to devour them at the first signs of hunger. Try to take only the smallest sips, and the tiniest bites.

During this time, you should be scanning the area for potential food or water sources. Can you hear running water nearby? Perhaps there is a stream. Depending on your knowledge of plants, you can search for edible berries or mushrooms. If you aren’t certain about a plant, though, don’t take a risk on eating it. You wouldn’t want to end up consuming something that is poisonous.

In fact, a safer food source would be any insects you can find. Thick caterpillars and beetles are especially high in protein. Delish!

The most important thing to do if you get lost in the woods is to stay calm. Worry and stress increase your heart rate and will only fatigue you faster. Trust in your ability to survive, and trust that help will come.

If you hiked with friends and simply strayed from the path, it’s likely you will be found soon. And if you decide to go hiking alone, always bring a map and compass. And make sure you know how to use them!