What happens when our work relationships hit rough patches: When your manager pulls you off a project, a coworker says something hurtful or takes credit for your work, or competition with a colleague makes you miserable?

While it may seem counter-intuitive, when the going gets tough, practicing forgiveness can be one of your most powerful allies, according to researcher Robert Enright, Professor of Educational Psychology at the University of Wisconsin-Madison, and the author of “8 Keys to Forgiveness.”

Whether at work or at home, anger and resentment can be a distraction that diminishes our productivity, destroys our sleep quality, and damages our health and relationships, according to research.

Forgiveness can be the antidote: “When people forgive, they do not excuse the behavior, they do not abandon the quest for justice, and they may or may not reconcile,” Enright says. But forgiving puts you back in the driver’s seat: Allowing the anger to lessen its grip on you and bringing a sense of peace that helps you move on.

When you decide the time is right, here are the steps to take:

Step 1. Admit that you are upset.

Tell yourself that it’s okay to be ticked off, angry, resentful, or hurt. We often deny our feelings, especially when they are strong or negative; and awareness is key. After you honestly recognize your anger and understand what triggered it, you can take the next step in the process of forgiveness.

Step 2. Make the choice to forgive.

Forgiveness means deliberately choosing to be good to those who were not good to you. It doesn’t excuse their bad behavior, Enright says. You just decide to be kind anyhow because holding onto anger does more to hurt you in the long run. It can lead to depression, anxiety, and a lack of connection to others. Your goal is to feel better, not to necessarily reconcile with the person who upset you. Doing this helps you focus on your happiness.

Step 3. Look for the larger context.

Now, go beyond your hurt to consider the other person’s worries and struggles. Recognize that they too have a backstory and pain. Recognize their individual value and worth and honor your shared humanity.

Why go to all the trouble for someone who has hurt you? Because this kind of understanding prompts compassion and that’s good for you, too.

Step 4. Get comfortable with the discomfort.

Forgiveness can be challenging, especially if the person who has hurt you doesn’t admit wrongdoing. But if you find yourself stuck, sit with the pain of what happened instead of deflecting it back onto the person who hurt you. Remember that behaving badly and hurting others like you were hurt won’t make it easier to get through.

Step 5. Be good to the one who was not good to you.

This is hard to do! But holding onto a grudge is tough, too. Over time the bitterness carries into our other relationships, ratchets up our anxiety, and even chips away at our self-esteem.

Letting go of a grudge means you can be friendly without being friends. Practice this by responding appropriately to any emails from the people involved. Say “hi” as you pass in the hall or offer a smile. Demonstrate through your actions that you have moved on. The interactions between you no longer have to be charged with hostility. Eventually, it will become easier to interact with the offending individuals. Resentment will ease a bit. And collaboration can continue.

However, remember that forgiveness does not ever mean letting inappropriate behavior continue. If a supervisor or coworker has crossed the line into bullying or abuse, seek help from human resources. Everyone deserves to feel safe and respected at work.

But when honest mistakes occur or friction between different personalities and approaches cause distress, deciding to forgive can be a way of restoring peace and harmony in the workplace and leave you feeling better.