As an entrepreneur, you’re no stranger to setbacks. You’ve developed ways of coping with disappointment and reversal.

But not all setbacks are created equal. Sooner or later, you might run into a problem that threatens the survival of your organization -- and your mental well-being along with it.

At Lendio, one of the previous companies I cofounded, we put much effort into a project my partner and I thought would pay off with historic speed. It didn’t. We hemorrhaged more than $1 million in the first few months of operation, and things only worsened from there. It took us two years to get back on track, and the emotional and physical toll were high.

Desperate times call for thoughtful measures. Here are five suggestions for keeping your sanity when the going gets tough.

1. Don’t feel sorry for yourself.

The natural tendency after you’ve suffered a gnarly setback is to feel sorry for yourself. Maybe you start indulging in cynical, pessimistic humor to mask your worry and lack of confidence. Maybe you start secretly blaming those around you for the mess you’re in: "Why did a winner like me get saddled with so many fools?"

Whatever form it takes, self-pity makes you pitiful. Instead of putting things in perspective, you'll see yourself as a unique victim of malicious forces. Nip that crap in the bud before it ruins you. Know you’re not the first entrepreneur to suffer a major setback, and you won’t be the last.

Focus on what you can control. Early on as an entrepreneur, I realized that my business credit scores and profile could either open or close doors. But it was on me to take care of them.

2. Right-size the problem.

We have a tendency in times of great stress to see everything as stressful. This is an emotional response, and you can correct it by right-sizing the setback's scope. If my marriage, kids, friends, civic activities or religious duties comfort me before a setback, there’s no reason for that to change afterward. I might be feeling tons of stress, but they aren’t the cause. Work is.

Reduce the number of things you allow to cause you stress. Remind yourself of all the good things you have in your life. At the end of my worst day at work, I go home and my kids still love me. If I take that for granted, I rob myself of an invaluable resource for maintaining perspective. “Count your blessings” is the last thing you want to hear in a crisis, but it’s actually brilliant advice. It isn’t a call for us to put on rose-tinted glasses and pretend everything is awesome. It’s a plea for us to balance our all-too-human tendency to focus on the negative with a paradigm shift that’s less intuitive but every bit as rational and necessary.

3. Get a life.

Although it’s true that huge setbacks demand huge amounts of attention, don't make the mistake of allowing work to overtake everything else. It’s tempting to do this because it gives you a sense of control when you’re feeling helpless. But at that point, work is controlling you, not the other way around.

You’ve disciplined yourself to count your blessings. Now, discipline yourself to enjoy them. Make time for normal life. A date night with my wife, playing with my daughters, seeing a movie with a friend -- these are the most effective ways I know to relieve the strains of business. Our minds are like muscles, and setbacks send them into overdrive. If we don’t allow them to recover, we exhaust them.

4. Stay inspired.

I remember how I felt after finishing Ashlee Vance’s biography of Elon Musk: I’ve got to get off my ass right now and do bigger and better things. I’ve got to see bigger, think bigger, act bigger. It was like a shot of adrenaline -- pure motivation.

During a setback, remind yourself of the stories of people who built and did amazing things. I’m not talking about the inspirational quotes you see on Facebook. I’m talking about the life stories of game-changers -- leaders who found themselves in the same spot you’re in now and fought their way through.

A work commute in busy traffic is the perfect time to listen to an audiobook that charges you with positive energy. It's the anecdote to brooding on your difficulties. The same goes for exercise: Fill your blood with oxygen and your brain with wisdom, simultaneously.

5. Be your own best student.

Setbacks create killer opportunities to refocus your life and build good habits. Don’t wait for retrospect to reveal what your setback was teaching you all along without your knowing it. Realize it today.

Imagine you're preparing to give a TED talk in six months about how you got over your current difficulties, and start taking notes. How did you get here? What would you do differently if you could turn back the clock? Since you can’t turn it back, what steps are you taking to efficiently move forward? Don’t leave out the psychological aspects. A close, honest analysis of your own mental processes when faced with discouragement and failure will discipline your thinking. It can help root out bad habits and lay the groundwork for a mindful, prosperous future.

There’s no magical or overnight formula to recover from a setback. Like any wound, it heals over time. Use that time to improve your business and yourself along with it.

More from Entrepreneur

Elizabeth's expertise can help you scale your business, build a personal brand and focus on being a value-driven CEO.