Whether you’re stranded on a desert island, deep in a dense forest, or facing a desolated city, there is one hidden peril that threatens our lives in all situations, and you can never outrun or hide from it. I’m talking about your own thoughts.

In dire situations, most people can quickly identify dangers from external forces and the need for water, food, shelter, etc. But an aspect of survival that is harder to consider is the need to fight against your own thoughts, emotions, and doubts. If you don’t, they can overcome you long before your thirst or hunger. Having a strong grip on your emotional state, and more importantly being able to control it, can mean the difference between life and death.

Here are some tips and tricks to keeping your mind healthy, rested, and in peak condition no matter what happens.

1. Do Not Blame Yourself. No matter what, do not fall victim to this line of thinking. It’s tempting to wonder what would have happened had you made a different decision, but it’s a waste of time that will only make you miserable and ineffective. The best way to avoid this pitfall is to make a conscious effort to focus on what to do next. For example, if you were forced from your home, you cannot change that. What you can start thinking about instead is where will you find new shelter or what can you use to improve it.

2. Reaffirm Yourself. This can make a huge impact. Even repeating a certain phrase in your head can change how you view things during tough situation. The key is knowing what will make a difference and what will be detrimental. “Do not quit” may seem like a good mantra, but an exhausted brain can easily slip up and start thinking “Quit, quit, quit.” A better alternative is “Keep going.” The worst that your mind can do with this is “Keep” or “Going”, both of which are positive things to think.

3. Address Your Emotions. Do not pretend to be John McClane, devoid of emotions. The truth is, you cannot escape your feelings or bury them down and ignore them. Bottling them up only makes them worse later. Instead, acknowledge your feelings as they come. If you admit they exist, it will be easier to accept, handle, and overcome them.

4. Stay Busy And Be Creative. Keeping busy can do wonders to prevent your mind from straying into dark corners. Fixing and improving your shelter, cooking, tinkering, anything to stay occupied. Have nothing to do? Pick up a length of cord and start braiding a bracelet. Start thinking critically, try to come up with some outside-the-box ideas, think of creative salvage plans or unique ways to ease your current situation.

5. Stay Positive. Always think of the positive things and focus on positive outcomes. This will prevent your mind from dwelling on negative aspects, especially ones not under your control.

6. Maintain Yourself Physically. A healthy body will keep your mind sharp and make it easier to stay positive. It is much easier to think happy thoughts when you are well fed and rested versus nursing a cold and tired.

7. Avoid Caffeine. It may give you a temporary boost, but it will only crash you harder in the long run. Drink water and stay hydrated instead, and your mind will be clearer. Same goes for tobacco.

8. Slow Down. Take a step back from the situation, allow things to develop, and collect more information. Take time to analyze and think things over so you can make a calm, rational decisions rather than ramping up your body’s adrenaline.

9. Remove Yourself. Completely removing yourself from a situation (if possible) can allow your mind to process what happened and deal with it. Once you’ve calmed down, return to the situation and make a decision.

10. Fake It Til You Make It. Plaster a fake smile on your face and pretend you are happy. Whistle, hum, do whatever you would do if you were on cloud nine. Soon you will no longer be pretending. Try this next time you are in a shit mood–it works better than you might think.

11. Maintain Perspective. No matter how bad a problem you face, compare it to the big picture. For example, if your food cache was eaten by some wild animals, be happy that you weren’t there when it happened and didn’t get injured. It’s all about perspective.

12. Have a Routine. Even in the middle of a long-term disaster, it’s still a good idea to have a routine. Knowing that certain tasks are done at certain times of the day is calming and requires much less mental power because it allows your brain to have periods of rest.

13. Focus on Breathing. A quick and effective way to calm your mind and regain control is to simply breathe and think about nothing but your breath. Inhale through your nose while mentally counting to 4, hold your breath while counting to 7, then exhale through your mouth while counting to 8. This is called the 4-7-8 method and it can be very relaxing.

14. Have Fun. Just because the world has gone to shit and things look bad does not mean life should be all work and no play. If you come across a putt-putt place, shoot a few holes. If you want to reenact a scene from Office Space, go for it and smash a copier. Small breaks to have fun will do wonders to keep you sane.

When in any survival situation, acknowledge that external forces are not the only ones you are up against. Keep your mind sharp, take control of your mental state, and steer your thoughts in a direction that will help you rather than hinder you. Not only will you be happier, you’ll have a better chance of surviving.