Cheating, of course, has consequences. Infidelity is one of the leading causes of divorce, says Lawrence Josephs, Ph.D., a professor of psychology at Adelphi University and author of Psychology Todays Between the Sheets blog. Partners frequently find out, and when they do they often suffer PTSD-like symptoms like recurrent, intrusive nightmares of their partners cheating. They become emotionally deregulated, enraged, depressed, and paranoid, putting their partner under surveillance because of a betrayal of trust, Josephs says. About 25 percent of children are aware of their parental infidelity, too, he adds.

With all the risks, why stray? Here are the most common reasons men cheat, along with tips to avoid the temptation.

Your emotional needs arent being met

The main reason men have long-term girlfriends on the side is their partners arent fulfilling their emotional needs and they need an ego-boost, say Josephs and Ava Cadell, Ph.D., sexologist, relationship coach, and founder of Loveology University . Cheating becomes an escapist solution for men who, though they love their wives, dont want to confront issues in their marriages.

Instead of seeking validation elsewhere, try to fix whats broken in your relationship with communication. Start out by spending 30 minutes to an hour daily talking about your day with your partner to act as each others sounding boards, suggests Cadell. And remember that cheating wont fix your problems. If its a long-term relationship, its a serious attachment. Its like having a second wife, says Josephs. Long-term affairs eventually deteriorate, and you end up having all same frustrations as marriages.

Youre feeling insecure

Maybe youve gained a few pounds and lost your hair, or maybe your career isnt panning out how you planned. If youre insecure in one area of your life, youll likely feel insecure in other areas too, including your relationships, says Cadell-and you might cheat simply to check youve still got it. Its to pump up virility and self-esteem with validation, not because a man is bored or frustrated in his marriage, Josephs says.

If youre feeling insecure or down, visit a therapist, who can recommend healthier ways to cope like counseling or antidepressants, Josephs says. You can also drop hints by complimenting your partner on a regular basis. Women pick up on this well, and it should trigger her to do the same thing, Cadell says.

You want more or different sex

Escorts, one-night stands, office flings: Casual sex often happens because men arent getting enough sexual variety and novelty, says Josephs-and instead of talking about it with their partner, they seek out a stranger to meet their sexual needs. Some women have very low libidos and a guys sex drive is through the roof, Cadell says. Research shows that men also want to have more sexual partners throughout their lives compared to women, says Lehmiller. And fights about finances, children, and chores throw a metaphorical wet blanket on the marital bed, says Josephs.

While plenty of men are afraid to talk about their sexual fantasies, both Cadell and Josephs say its essential to negotiate your sex life with your partner before resentment sets in. So if you want sex daily while your partner is in the mood once a week, aim for three times a week. Or shake up a stale routine by starting a sexual bucket list of new things you want to do, both inside and outside the bedroom-from salsa classes and ice skating to tantric sex and bondage. Then take turns planning dates to hold yourselves accountable.

Youre out for revenge

One of the highest predictors of cheating is being cheated on, says Josephs. A man might also revenge cheat as the quickest way to heal an ego after his partner lied to him or publicly humiliated him.

Of course, getting back at your partner is tempting. But remember that cheating just makes a bigger mess. You need to nip anger issues in the bud before it turns into deep resentment and contempt, says Cadell. Instead, try to be the bigger person and assert yourself by being open and honest about how you feel. Tell your partner her actions hurt your feelings and made you feel like she doesnt love or desire you, Cadell suggests. And if you still have trauma to work through, head to counseling.

You get caught in the moment

More often than women, men sometimes cheat because they find themselves in an opportunistic situation-theyre at a work conference or on vacation without their partner, had a few drinks, and flirting leads to the bedroom, says Lehmiller.

To avoid the temptation to cheat, be proactive. Since alcohol is often involved in these situations, says Lehmiller, minimize your consumption at bars and clubs. And try to think ahead and prioritize your relationship. If you have empathy and understand the trauma that infidelity would inflict, you dont want to take that risk, says Josephs.

Youre a lifelong cheater

Plenty of people in high school and college treat dating like a game-and getting away with cheating feels exciting. People often get it out of their system and learn that game-playing doesnt work out in the end, says Josephs. Those who have a good ability to delay gratification and can see the long-term consequences of their actions tend to take a pass on cheating.

Some men, however, are aging playboys who never grow up. When theyre single theyre more likely to have promiscuous casual sex, and when theyre married theyre more likely to cheat, says Josephs. He explains that lifelong cheaters tend to share three characteristics known in psychology as the dark triad: narcissism (theyre arrogant); psychopathy (they dont consider other peoples emotions); and a Machiavellian intelligence (being manipulative to get their way in relationships). That means they tend to think they can break the rules and get away with it, and they feel guilt-free about cheating. Since theyre rarely open to changing, they often only reform when their marriages fall apart.

People abuse their power and cheat to make themselves feel superior, but it cant go on forever. At some point something happens to their health or finances, and they get a wakeup call and realize that the grass isnt greener. Its perfect where it is, says Cadell. So if youve found someone with all qualities you love but just cant keep from straying, its probably time to see a therapist.

Discussing sex and your relationship

A lot of men arent comfortable showing vulnerability and talking about their feelings, but authenticity is linked to relationship quality and satisfaction says Josephs. So communicate about what you want from your sex life and work through your issues with your partner. Also get on the same page with your partner about what constitutes cheating. People often have different ideas. Talk about whats acceptable so its unambiguous and one person doesnt engage in an act that hurts the other person, Lehmiller says. The best time to start these discussions is early in your relationship; the longer you go without bringing it up, the more awkward and difficult it can be later on, he adds.

If you are ever tempted to cheat, think about the long-term consequences to your relationship and why its better to confront the core issues behind your inclination. When people are insincere and dont show vulnerability in their relationships, they grow apart, says Josephs. People who are willing to take risks and be honest have better relationships. Its scary, but it creates a moment of truth.

And if you do cheat, own up to it instead of sweeping it under the rug. The relationship could even be better than before the infidelity once its addressed, says Josephs.