While it's often easy to be mentally strong when life is going well, your true strength becomes apparent through adversity. The loss of a loved one, a health problem, relationship issues, and financial troubles are just a few of the hardships most people face at one time or another.

The way you think about life's inevitable obstacles affects your ability to cope with tough times. Developing a productive inner dialogue is one of the most productive ways mentally strong people keep building their mental muscle. Repeating positive, yet realistic affirmations can drown out the negative thoughts that can hold you back.

Here are nine things to remember when you're going through tough times.

1. I have what I need to get through this.

Thinking things like "I can't do this" or "This isn't fair" will cause you to feel defeated. Rather than insist you need more, remember what you already have. If you've made it this far in life, you clearly have some skills, tools, and resources already in place.

2. Living according to my values is what really matters.

There are going to be people who won't like you and times when people will disagree with the decisions you make. But your job isn't to please everyone. Be brave enough to live according to your values, even when that means making unpopular decisions.

3. Failure is part of the road to success.

Failure isn't fun, but beating yourself up over it won't help. Each time you fall down, it serves as proof you're pushing yourself to new limits. Remember that each failure is an opportunity to grow stronger and become better.

4. All I can do is my best.

Demanding perfection from yourself will do more harm than good. Whether you're interviewing for a job that you really need, or you've got one last shot to try for that promotion, insisting there's no room for error will skyrocket your anxiety. A little self-compassion will help you perform at your peak.

5. Five years from now this won't matter as much as I think it will.

Keep temporary problems in perspective by reminding yourself that the emotional pain, anxiety, or turmoil won't last forever. Many of today's crucial decisions and major worries won't actually matter that much a few years down the road.

6. I'm stronger than I think.

A serious health problem or the loss of a loved one can be very difficult to handle. But catastrophic predictions like "I'll never recover from this" or "I won't ever be happy again" will only drag you down. Adversity often reveals hidden inner strength you never knew you had.

7. I can handle feeling uncomfortable.

It can be tempting to stay inside your comfort zone, but getting through tough times often requires you to do something different. Although emotions like fear, embarrassment, and disappointment are uncomfortable, they won't kill you. Be willing to face those emotions head on and you'll gain confidence in your ability to cope with discomfort.

8. I am in control of how I think, feel, and behave.

Blaming other people for what's going on in your life won't help your situation. Acknowledging that you're in control of how you think, feel, and behave can empower you to either make the best of your circumstances, or create positive changes in your life.

9. I've been knocked down before and I can get back up again.

Look back at the times you've persevered before. Recalling your fortitude in dealing with past struggles can help you summon the strength to deal with current problems.

Giving yourself positive affirmations alone won't necessarily change your life--the way you think is only one of the three core factors of mental strength. But healthy self-talk will help you feel better and inspire you to behave more productively, which is key to getting through tough times.