You’ve probably been here before: You’re in the middle of getting hot and heavy with your partner and — ding! — up pops a thought about tomorrow’s big work deadline.

Your mind journeys to that dull but persistent land of worries it loves to visit, and then you realize it’s doing that, and you spiral into: WTF, brain, there’s something much better going on right now, please pay attention!

Luckily, because this isn’t a rare phenomenon, sexperts know a couple of good ways to. solve it — through fantasy, or by practicing mindfulness.

“Pretty much everyone deals with intrusive or distracting thoughts during sex,” Vanessa Marin, a sex therapist and creator of Finishing School: Learn How To Orgasm, tells Greatist.

By giving our minds a more relevant task, we can have way more fun. Should that task be fantasizing — imagining yourself in a different erotic situation, possibly with someone else or somewhere else? Or should you attempt to be mindful, paying attention to every physical sensation and emotion of the present moment?

Here’s how to determine which practice works best for you.

Since many of us thought about sex long before we were actually having it, fantasy is a much more familiar concept. And yet, Marin says it has a bad rap, usually because people feel uncomfortable about what their fantasies are, or they worry that fantasizing about people other than their partners is wrong. But some imaginative thoughts can actually benefit our real sex lives.

A study of couples found that those who engaged in fantasies involving their partner (both when prompted to do so in a lab setting and organically at home) were more interested in having sex with their partner as well as in doing good things for their relationship.

Fantasy can actually be a really great way to stay more mentally engaged in the moment.

You can be imagining you’re having sex in a castle overlooking the Mediterranean as opposed to remembering to take out the recycling.

In addition to being a good home for taboo thoughts, our heads are an ideal place to experiment with things we might actually like to do later on. That could mean a new position, a pleasure-enhancing sex toy, or whatever else your imagination conjures up.

“Sometimes people need to play around with the idea of [something] before they can really get a sense of whether this is something that they want to bring into their real-world sex life, so fantasy can be super helpful in that way,” Marin says.

While some of us have no trouble picturing a reenactment of our favorite Outlander scene (ahem), the kind of fantasy that will truly enhance sex with a partner is more purposeful than just escaping to the Scottish Highlands.

“When fantasy is going on inside of you and you don’t let your partner in, that builds a wall and that might actually leave your partner feeling very alone and like you’re not actually there with them,” sex and intimacy coach Irene Fehr tells us.

What you might do instead is a more purposeful kind of fantasizing that involves your partner. “Talking about fantasies with your partner can be a great way to bond and to explore new things in your sex life,” Marin says.

“If done really vulnerably and sensitively, it could be an incredibly connecting experience, and it could be a huge turn-on for both partners,” Fehr agrees.

If you’re not someone who fantasizes much, but you’d like to try, Marin suggests practicing on your own first. And don’t be too hard on yourself if you find that fantasies don’t turn you on at all. Some people are much more excited by the here and now, in which case, read on…

You might be more familiar with mindfulness as a meditation practice. It often begins with experiencing the breath, noticing it as a physical sensation, and then acknowledging the thoughts that come into your head without judgment.

It’s also a practice that can extend to everything you do, from eating to interacting with people, to having sex.

“The basic concept behind mindfulness is tracking your experience from moment to moment, paying attention to the sensations that you’re feeling, the emotions that you’re having, what your body is feeling, and kind of staying present with that as it keeps shifting and changing,” Marin says.

Mindfulness training has been shown in several studies to increase sexual arousal and enjoyment and reduce sexual dysfunction (such as pain during sex). It’s no wonder sex therapists are frequently turning to it as a technique to teach their patients.

Fehr says during sex, mindfulness — or “bodyfulness” as she calls it in this scenario — is about noticing what’s happening and reacting to it accordingly.

“Noticing, for example, that your partner’s touching you, you’re touching them, and you’re noticing that you’re feeling really turned on, and you’re wanting now to do something else. Or you’re noticing that you’re contracting, and your body wants to slow it down.”

Noticing is one thing, but actually communicating what you’re experiencing with a partner can also feel intimidating or awkward at first. Before you even go there, Marin says you might want to practice mindfulness meditation on your own. Apps like Headspace, Insight Timer, and Meditation Studio are an easy, low-pressure way to try it out.

“If you build up a little bit of a foundation, learning those basic techniques outside of the bedroom, it can be a lot easier to bring into the bedroom to experiment with,” she says.

When you feel comfortable with the concept, Fehr says mindfulness with a partner can become what she calls “connection sex,” in which the two of you keep your eyes open to witness each other’s pleasure. While you’re completely present in that moment, you also stop seeing orgasm as the only goal.

“The goal is just to take the next step just to reach out and touch your partner in a way that feels good to you in this moment,” she explains.

Just as fantasizing isn’t for everyone, neither is mindfulness. Someone who has experienced sexual trauma or violence, for example, may not do well with it until after getting therapy or other professional help.

“For some people, the act of being mindful can bring up a lot of vulnerability,” Marin says.

You won’t know for sure what’s best for you until you try it. And, well, there are worse ways to spend a night in.

Sabrina Rojas Weiss lives in Brooklyn, surrounded by her fellow freelance writers and competitive stroller-pushers. Follow her on Twitter@shalapitcher.