The Leadership Insider network is an online community where the most thoughtful and influential people in business contribute answers to timely questions about careers and leadership. Today’s answer to the question: What did you learn from your biggest failure? is written by Russ Becker, president of The Forum Corporation.

A few years ago I was leading a division of a publicly traded company when we missed our revenue expectations by a very large amount. To say that I was surprised by this outcome would be an understatement. I was completely blindsided and by the time the issue came to light it was already too late to rectify the situation. This error impacted the entire company; it led to missed revenue expectations, a drop in stock price and market cap valuation, and negative press.

First and foremost, I should acknowledge that the CEO of the company — while certainly disappointed in my performance as the leader of the failed division — allowed me to keep my position and encouraged me to use this bump in the road as a learning experience. For this, I am grateful and I realize that not everyone gets second chances. But this experience shaped my entire approach to leadership and attributed to my career growth in the years since. Here are a few key learnings that I took away from my biggest failure:

See also: Smarts Alone Won’t Guarantee a Successful Career

Stay calm
No matter how bad something may seem in the moment, in the long-term it is never as bad as you initially think. Give yourself time to clearly understand the situation and avoid overacting. This is crucial in order to arrive at a solution and
to move forward.

Reflect
Step away from the situation
, clear your head, and get perspective. In my example above, I realized I needed to take a step back to fully understand what happened and why our expectations were so far from reality. I was able to take responsibility for my mistake and discovered I wasn’t immersing myself enough in the day-to-day operations. Being aware of my shortcomings allowed me to reassess what I needed to do on a daily, weekly, and monthly basis in order for this to never happen again.

Learn from it
My kids are active in recreational sports and I encourage them to treat every game — no matter how important — as practice for the future. Even if it’s the final game of a major basketball tournament, they should use the experience as an opportunity to grow their skill set. This same mindset should be applied in the workplace. Everything, whether it be a failure or success, is an opportunity to get smarter for the next challenge.

Talk to peers
Experiencing a failure is the perfect time to turn to your professional network,
whether it be colleagues or friends, for feedback and advice. These same people can be the network that you turn to throughout your career for real-time feedback in future situations.

I can honestly say that I emerged from my failure as a stronger leader. The experience impacted my broader leadership style beyond just numbers and management, to helping my employees understand how their roles shape the company performance. I stayed on at that company for many successful years because we got smarter about our business as a result of the situation. Sometimes by losing, you gain an understanding of what you need to do to win.