A women who’s getting over heartbreak, holding her head in her hands and thinking.

When heartbreak comes, no one is prepared. It can make the strongest of us cry, scream, or otherwise go crazy. The pain that comes with a heartbreak drags on and on, often with no end in sight. If you’ve felt this way, it’s because your mind isn’t doing you any favors. An emotional injury doesn’t just heal with time the way a physical one might. So what’s the best way to move past a recent heartbreak? We chatted with Psychologist Dr. Guy Winch, author of the new book How to Fix a Broken Heart, to figure out just that.

Let’s start by talking about what happens during a heartbreak, because context is important. Heartbreak is a type of emotional injury, a sort of chronic emotional pain that happens following what our mind sees at a traumatic experience. According to Dr. Winch, heartbreak can come from a long-term relationship, but it can also happen before the first date. When we’re experiencing heartbreak, our mind makes us live through the pain over and over again. Our brain wants to prevent us from doing the thing that hurts,” explains Winch. “The same as if we touched a hot stove when we were kids. The mind reminds us how much that hurts, which is great for a hot stove. Our mind will constantly bombard us with idealized images of that person and these amazing memories of all the best moments. The goal is to make it very painful, so we don’t do that again.”

Basically, your mind is playing reruns of the best times with your ex or partner to really make you feel the pain of loss in hopes that you’ll never date or cause that level of distress again.

That means, the key to getting over heartbreak is breaking the loop—actively changing your thought patterns, so your mind can recover. But breaking this loop isn’t easy. Most of us haven’t even realized that our minds are doing this, let alone learned a way to stop it. The battle against yourself to get over a heartbreak is a tough one, but there are a few things you can do that help.

“Our goal during a heartbreak is to think of the person less and make it hurt less when we do think of them,” says Winch. “All of that maintains you give that person a big starring role. Our goal is to get them out of the cast in general. We know from functional MRI brain scans that what goes on in our brain when we’re heartbroken is really similar to what goes on in the brain of an opiate or cocaine addict when they’re going through withdrawal.”

If you want to get over the heartbreak, you need to begin by reducing contact with that person or cut it off completely if possible. This includes checking in on their social media. Each time you do this, you reopen the wound. Give yourself some distance from the person who broke your heart. This will get your mind used to functioning without them as part of your daily life.

Next, it’s important to try to think about the person less. Dr. Winch recommends using any and all tools at your disposal, namely willpower and distraction. The more time your mind spends away from the person in question, the better. Go on dates. Spend time with friends. It takes willpower to get over a breakup. Sometimes you have to force yourself to do the things that are good for you, even if they don’t sound appealing.

Of course, heartbreak is always an uphill battle. The important thing is to take an active approach to get over it. Even when you know what you should do, it’s by no means a simple hurdle. Give yourself time. Figure out what’s happened in the wake of your heartbreak. But get to working on recovery as soon as possible. It won’t happen without you.

Alex Bocknek

Alex Bocknek is the senior editor of The Date Mix and works at Zoosk, the online dating service. He’s also a recovering music critic and an aspiring fiction writer (probably lost) on the way to an independent bookstore near you. He can be found occasionally musing about politics, philosophy, and love in the modern world.