Maybe you’re beating yourself up for sending a trivial email to your boss instead of a co-worker. Or maybe you showed up late for an important meeting, angering a high-profile client.

Whatever the size of your mistake, workplace errors happen every day, and they don’t just happen to you. You might feel humiliated and want to avoid colleagues or your supervisor. But you can turn this incident into a lesson and own your mistake.

Even if you didn’t mess up and are taking the blame for someone else’s mistake, you can use it to your advantage. Check out the following ways you can get through this setback.

Gain perspective

When you slip up at work, you’ll probably panic, get overwhelmed or feel embarrassed. And the feeling of dread might not stop until you talk with your boss or confront a co-worker. These are all common reactions to making a mistake because your nervous system responds to your guilt and frustration.

But don’t let yourself worry about the blunder for long. Push past this disappointment by taking it into perspective. It’s likely your company will move on from this situation quickly. Release your negative emotions, forgive yourself and start moving forward.

Explain yourself, but don’t sugarcoat it

Sometimes context can help your predicament and show you aren’t to blame for a mix-up. It doesn’t hurt to explain what happened to your boss, but stay away from excuses. For example, maybe you saved a file in the wrong format because no one gave you the right instructions. Your feedback can keep someone else from making the same mistake in the future.

When you defend yourself, don’t try to lessen your part in the mistake. If you shift the blame, you are only making the problem worse by throwing someone else under the bus. And depending on how big the mistake was, shifting the blame or otherwise lying could have serious consequences, both to your career and sometimes legally. The best way to approach on-the-job errors is to be earnest. Which leads me to my next point…

Take responsibility and be honest

Chances are your boss also makes mistakes and understands perfection isn’t attainable. So, accept responsibility when you do contribute to a problem. Being accountable for your actions can produce more trust and show maturity.

Research from the University of Oxford and the University of Bonn suggest it pains people to lie, but that more dishonesty happens in the workplace. But people respond more positively to honesty than you’d think. Stand out as an employee by telling the truth rather than covering up your errors.

Recover by finding a solution

The most effective way to gain back the confidence and respect of your colleagues is to right your wrong. When you think on your feet, you can find a solution to your mistake. Act fast, and people will quickly forget your snafu.

If you rarely make mistakes, your reputation doesn’t have to suffer from this outlier. Show your consistency with efficient problem-solving and a quick recovery. Failure is a natural part of life, but overcoming adversity is also necessary.

Show you learned for the future

If you didn’t mess up, you don’t have to apologize or take the blame. But you can communicate how you learned from the situation. Discuss with your boss or co-worker how you grew from the experience, and how you will approach it differently next time. Each opportunity you get to demonstrate your competence, even in navigating a mistake, can push you ahead in the workplace.

A study by Michigan State University researchers found people who think they can learn from their errors may have a different reaction in their brain to mistakes than those who don’t expect to learn from their mistakes. This reaction helps them correct errors better. Use your mistakes to improve your future performance, and look forward to seeing positive results.

Use your mistakes to become better

Setbacks happen to everyone, but how you react to them determines your progress. If you transform your failure into a growth experience, you can effectively own your mistakes in the workplace. Regardless of who is at fault, you can recover from this situation and become better.