Kids respond to the classic “What do you want to be when you grow up?” question with definitive, enthusiastic responses. No one ever says they want a career fraught with hurdles, switchbacks, and pitfalls, yet that’s what we should prepare young workers for. Every professional encounters a degree of workplace adversity at some point, but if resilience is a strong part of your personal brand, adversity will actually help you thrive.

But what’s the source of that resilience? Why do some people weather the most treacherous storms brilliantly while others wilt at each career problem? The secret to overcoming work challenges lies not in the intensity of the problems but in the intention of our minds. By learning to rein in our emotions and redirect our perspectives, we can turn hard times at work into opportunities.

No such thing as bad luck

One method of reversing petulant, failure-focused neural patterns is by practicing learned optimism, a technique that shifts the brain from registering helplessness to acknowledging hope when encountering obstacles. We’ve all known the perennial victim who seems to attract tragedy. However, even someone who continuously rolls snake eyes can remain cheery by using learned optimism.

What does learned optimism look like in practice? Consider a boss facing the prospect of instituting layoffs or being fired herself. Instead of dreading her role and becoming enmeshed in negativity, she could reframe the event. Perhaps she’ll get to work in a better capacity down the road, such as when Steve Jobs was fired from Apple only to return as its savior. If she’s having to terminate underperformers, this will enable the company to become more efficient or productive in the face of disruptive competitors. Viewing those pinks slips in this light will help the boss find the positive impact in her unpleasant task.

Through learned optimism, anyone can feel more in control, which can have wide-ranging benefits. One study published in the American Journal of Epidemiology showed that optimistic women actually had better odds of beating cardiovascular disease and cancer than their negative counterparts. Plus, consider the ripple effect of positivity: A life blossoming with gratitude could be a blessing not just to oneself but to every person one encounters. And positivity is attractive. In fact, the results of my company’s 360Reach personal brand survey show that those who are described as positive and optimistic are more likely to be described as confident, competent, and respected.

Of course, this doesn’t mean some hardships aren’t truly hard. Singing “The sun’ll come out tomorrow” worked for Annie, but it isn’t always the right tune for every tough occasion, whether it’s getting fired, enduring a hostile boss, or surviving any number of difficult moments that can happen at work. But you can be honest about your frustration and your fear while still looking diligently for the silver lining. That will help you evolve beyond even seemingly insurmountable moments and give you the power to put yourself in a better situation.

A growth strategy built on positivity

If you struggle to adapt after downfalls or bounce back from pain, get ready to make a huge leap forward. How? Adopt one or all of the following strategies to discover a calmer, more pleasant way to cope with your job’s micro and macro stressors.

1. To find peace, accept responsibility.

You bungled a project, leading to a cascade of anger and swirl of embarrassment. Though it’s hardly your finest hour, the only way to move past the experience is by acknowledging and accepting what happened. Rather than beating yourself up or playing the blame game, seek creative solutions to the problem; that’s true responsibility.

After doing everything you can to soldier through the muck, examine the timeline that led to the issue. Was there anything you could have done differently? What was out of your control? Complete a 360-degree evaluation of the occurrence and then move on. The faster you let go, the faster the experience will be out of your rearview mirror.

2. Shift to divergent thinking.

You probably have learned to think in a convergent way. Convergent thinking offers clear choices with few or no gray areas, limiting your ability to think outside the box, a trait essential to developing a positive mindset. In contrast, divergent thinking has no restrictions. Divergent thinkers see cosmological openings, not sky’s-the-limit barriers.

For an example of divergent thinking, consider the case of Michael Cammarata, founder of Random Occurrence, a venture capital and private equity firm. Diagnosed with dyslexia at a young age, Cammarata now considers the condition that made school a trial for him a lens through which to see the world from different angles. Despite his challenges, Cammarata co-founded Schmidt’s Naturals in 2015, one of the world’s fastest-growing wellness brands, which was acquired by Unilever in 2017. To him, each day is a chance to learn through tribulations and work from a clean slate. “Don’t lose that ability to be agile and to think creatively,” he advises. “An artist wouldn’t sell the same painting over and over again.”

3. Become a practitioner of stoicism.

Often portrayed as emotionless, stoics have gotten a bad rap. They’re actually philosophical thinkers who accept the world’s unpredictability as a given. Rather than waste time in hand-wringing over external forces, stoics thoughtfully and calmly observe every situation. Then they act with wisdom.

In terms of personal branding, those who have developed a reputation for staying rational and calm in the face of tumult definitely have an advantage over drama addicts. As noted by Ryan Holiday, author of “Ego Is the Enemy” and “The Obstacle Is the Way,” stoicism “helps us manage and think through our emotional reactions” and “can make these kinds of situations easier to bear. It can help you manage and mitigate the triggers that seem to be so constantly tripped.” Start by not allowing other people’s fears to live rent-free in your head. Next, do nothing without purpose. When facing stressful situations, reassess your actions to ensure that they’re deliberate, not the result of autopilot or knee-jerk overreactions. Finally, resist holding onto negative emotions.

Everyone encounters rough patches at work. That’s OK. Embrace your inner optimist. Focus on solutions, not blame. And keep a clear head as well as an open mind. The road ahead might be bumpy, but with positivity, challenges can lead to bold adventures. With the right perspective, you might even go back to being excited about what you want to be when you grow up.