It’s the most wonderful time of the year … unless the holidays make you pine for an ex. Yes, even though it’s the season of twinkly lights and good cheer, it can also be the time for past relationship nostalgia to arrive, “messing up your mind,” as one blogger put it.

There are several culprits. First of all, our culture expects this time of year to be full of nonstop joy, which can compound the loneliness of not being with someone you used to love, especially if the split happened in the past year. Second, most people have traditions they follow every year, so a change will be noticed more starkly than in, say, April. Third, it’s also engagement season and, for many, colder weather means we’re spending more time indoors, with fewer social distractions.

And to top it off, we now have access to snippets of what friends and strangers are doing, thanks to social media, which can make for a stark contrast to our own lives.

For Emily M., 34, an editor in New York who spoke on condition that only first name and last initial be used, Thanksgiving was the holiday trigger that made her reach out to an ex-boyfriend. “This is the first year I’ve really been single over the holidays, and it’s affected me more than I expected it to,” she said. Even though Thanksgiving is not a “particularly important” holiday for her, scrolling through so many cheerful posts about it on social media exacerbated her loneliness. “Seeing other people spending time with their loved ones when I was alone made me feel like something was lacking in my life,” she explained.

While Emily was thinking about her exes, she texted a brief “hello” message to one she’d dated for a few months earlier this year, but who hurt her “pretty badly.” One thing led to another, and now they’re dating again, even though she knows it’s probably not going to last. She’s still thinking about whether to get him a Christmas present.

According to sexologist Logan Levkoff, who advised couples on three seasons of “Married at First Sight,” it makes perfect sense that this time of year can throw us into such an emotional tailspin. “The holidays put us in this fantasy-like trance where we think everything is so blissful. If we’re not exactly thrilled with where we are romantically speaking at the moment, we go through these moments of feeling, wow, that’s what I was missing,” Levkoff said.

For many, Hanukkah and Christmas come with long-standing traditions that can make us think about our exes and how we used to celebrate with them. Whatever your usual routine used to be, you have to get used to a new one. When Justin Myers, a columnist for Britain’s GQ magazine, and his boyfriend of eight years broke up, the Christmas afterward felt “uncertain and unnerving.” Even though he knew he was better off solo, when he got a casual holiday text from his ex, it gave him pause. “I felt nostalgic for the intimacy but not necessarily eager to go back.”

The stretch between Thanksgiving and Valentine’s Day is known as engagement season, meaning it’s likely someone close to you is sporting a new rock on their finger that they’re all too eager to show off. Last year, Solo-ish contributor Meghan O’Dea thought she might be one of those heart-eyed engaged couples . . . until her boyfriend dumped two days before Christmas. This year, rather than be reminded of the demise of her relationship, O’Dea is opting out of official holiday celebrations in favor of a solo vacation to San Francisco. “It’s very important to me to do something just for me,” she said, because the season comes “with a lot of pressure to participate.”

Myers says this season is fraught for many in the LGBT community, especially if you’ll be spending time with family who are less liberal than your friends. “If you’re not out, or only out to some, it can be very hard having to suppress who you really are,” Myers said. “Being estranged from family can make Christmas unbearable. You may find yourself latching onto happy memories that maybe weren’t all that great in the first place, but at least you weren’t alone.”

It’s not just single people who are afflicted. I’m in a six-year happy relationship, but I still feel that pull to get in touch with exes, especially if I spent holidays with them years ago. Levkoff explained that sometimes what can seem like missing an ex is actually about missing their relatives. “Maybe you were accepted more by someone else’s family than you were by your own. That’s a lot of people’s reality. It makes perfect sense to want to feel that way again,” Levkoff said.

If you’re thinking about firing off a friendly hello to an ex, do so cautiously. Levkoff recommends being wary when sending that seemingly innocent email or text to the ex who’s on your mind every time you hear jingle bells. “Reconnecting with an ex can cause you more problems than it’s worth. You could start this whole thing over again only to find out that there’s a reason you broke up in the first place,” she warned. Levkoff suggests asking yourself if you’d be thinking about them if this were the middle of summer; if so, maybe that renewed interest is worth investigating. Otherwise, it might just be holiday nostalgia.

When making this momentous decision, therapist Aida Manduley recommends asking yourself: “Are you reaching out for selfish purposes or for some genuine connection and perhaps mending a bridge? Are you reaching out to fill a void that someone in your current life isn’t filling?” That’s not to say you should never try to connect, but to temper your expectations. Is a momentary rush of attention worth potentially jeopardizing the progress you’ve made in getting over an ex?

What about if you’re on the receiving end of a missive from a long-lost ex? Manduley advises keeping your response brief and polite, making sure to deflect or call out any unwanted flirting. It can be a slippery slope from fond reminiscence to something far more intimate than you’re prepared for.

Another solution is to be proactive if you know or suspect you’re prone to messy emotional entanglements over the holidays. Emily is already gearing up for Thanksgiving 2018. “Next year I’ll have a better plan for how to spend my holidays so I don’t get so bogged down in feelings. I’ll definitely make plans with friends or have people over so I don’t end up feeling lonely and vulnerable again,” she said.