You’ve just learned the unthinkable: Your significant other cheated on you. It’s the twist every one of us in a committed relationship dreads facing the most, and now it’s happening to you. Your mind is reeling, your heart is racing, and you’re hurting so much, you’re not sure you can go on. But you have to.

Believe it or not, there are things you can do — productive, healthy things — when you find out your husband or boyfriend has betrayed you in the worst possible way: by being with someone else. At a time like this, when you’re in complete shock, denial, disbelief and pain, it’s all you can do to wake up in the morning and get out of bed. But there are other ways to cope with such a devastating revelation.

Here are seven steps to take when you find out he cheated on you.

1. Decide whether you want to stay with him or not, and whether your relationship is worth saving

This will take some time after you’ve processed what happened. One way to figure out whether you should stay together and fight for your love is to be honest about the type of man he is and the sort of betrayal involved. If he’s not the kind of guy who strays and it seems like it was a one-shot deal, you should try giving him another chance. Ditto if he confesses the affair or at least apologizes profusely and seems genuinely remorseful once you find out about it.

“Slip-ups happen, but the good news is that when they truly are slip-ups, they’re survivable,” William July, the author of Confessions of an Ex Bachelor, tells Cosmo.

But if he’s done this before, this was more than just a one-time thing (i.e., it was an actual full-blown affair or romantic relationship with someone else), it happened with his ex, or he doesn’t seem the least bit sorry, think long and hard before choosing to stick it out.

2. Talk it out

“If you decide that you do want to work things out with your guy, you’re going to need to really talk about what happened and why,” licensed sex psychotherapist Vanessa Marin tells Bustle. “What was he feeling … and how did he feel after it happened? I know this step might feel excruciatingly painful, but it’s important for you to hear him out.” Likewise, your guy “needs to hear what you have to say too” when it comes to your feelings about his infidelity, she says. “He has to understand how his actions hurt you, and has to be willing to give your emotions some time and space.”

3. Take a break from each other

This might seem like it could do more harm than good, but even a short break from all contact with your husband or boyfriend after he’s been unfaithful can help you regroup and guide you on where to go from here. Without the distraction and hurt that comes with talking to him, especially right after you find out about the cheating, you can begin working through it all with a clearer head.

4. Go to couples counseling

Sometimes, the only way to communicate effectively about something as painful as cheating is to get an objective, and professional, third party involved. Otherwise, the discussion could escalate into a terrible fight where nothing is resolved and damaging things are said. With someone else in the room, couples dealing with infidelity — or any other relationship woes — often have more success in “fighting fairly” and communicating in a healthy way about what happened and how to fix things.

5. Get to the root of the problem

Through weeks and months of intense discussions and therapy sessions, where you are really, truly listening to each other about how each of you is feeling along the way, you should be able to get to the bottom of why he cheated. Maybe he was angry with you about something else and didn’t know how to express himself, so he acted out instead. Maybe your relationship was on the brink of getting more serious and he got scared — and the cheating was actually a sign that he saw himself with you forever. Not only do you need to figure out why the cheating happened but what led to it in the first place and how you both may have contributed. Once you get to the heart of the matter — and neither of you may ever fully grasp all the reasons — you can start to work toward doing what it takes to avoid it in the future.

6. Forgive, let it go and move on

Embrace an improved, renewed relationship that’s more fulfilling, profound and honest than ever before. “You can either handle being vulnerable with your partner again or you can’t,” says Dr. Phil on his website. “If you can’t, you need to get out of this relationship and move on. And if you can, then you need to let him/her earn the trust back and start putting this relationship together again. Forgiveness is a choice.” Chances are, after both you and your guy have done the difficult work of repairing your relationship, you’ll come away with a much better understanding of each other and a significantly deeper connection and commitment to each other. That, in turn, will strengthen your love and bring you closer together.

7. If you can’t get past the affair, even after months of hard work, break it off

It’s just not worth any more of your time and heartache, so you might as well start the painful process of ending your relationship now. “Ask yourself if this is going to be a life sentence for your partner,” Dr. Phil advises. “Can you heal from this and forgive? If not, don’t continue to live in anger and/or be with someone who causes you pain.”

Have you ever been cheated on? What steps did you take after you found out?