Cloudyworld,
I'm so sorry you're here, but so glad you found us.
People say no sex, unhappy, poor treatment and the reasons that lead to an affair.
That thinking is a myth. It's flawed thinking about "why" people have affairs. That thinking puts at least partial blame on the person who is oblivious that their partner is making secret decisions and taking secret actions to betray the marriage.
Even in a "bad" marriage (and no relationship is perfect), cheating isn't justified. If the cheater was miserable in their committed relationship, they have many ways to resolve it--incuding leaving. Cheating is never justified.
That said, LOTS of cheating happens in happy marriages. It's a mind bend, I know.
What you're coming to terms with is that the cheating was due to an extremely flawed partner. Every person who cheats does it because of their own needs. It's not their partner's fault. It's not their relationships fault. It was their own choice.
What cheaters have in common is that they are self-focused and lack empathy. The affair was feeding their own need, at the expense of their spouse. Scary stuff.
In your husband's case, it seems like he had a Knight in Shining Armor (some shorten this to "KISA") thing going on. He gets a powerful feel-good brain chemical dump when he is "fixing," supporting," and "helping" a woman who is a mess. He justifies his actions to himself by telling himself she "needs" him...but he is doing this at the expense of betraying you and risking your safety (with sexually transmitted infections). He also does this at the cost of is own vows and the destruction you'll feel upon discovery. He helps her...and himself...but destroys you in the process.
He likely wasn't thinking any of that consciously. He wasn't allowing himself to see the costs or the damage. He was focusing on his needs and what he was getting out of it. He was compartmentalizing.
None of this justifies what he did--making choices and taking conscious actions moment-by-moment, day after day, for years. But it does lend insight in why he did it. Again, terrifying stuff--to realize that our partners are so self-centered and lacking in empathy for us, the people they made commitments to, the people who should be able to trust them the most?? It's scary that our partners can compartmentalize and justify destructive actions on that level. It's mind blowing and terrifying.
And painful. So very, very painful.
So, yes, you'll find a legion of people here who get it and who truly empathize with your pain. There is a wealth of experience here.
Draw some strong boundaries to protect yourself. What helps you feel safe right now? Does he need to sleep in another location? Does he need to live in another location?
It's common to ask for complete access and transparency on all electronic devices.
It's common to ask that he seek individual counseling (from a counselor who understands that the marriage wasn't at fault).
Individual counseling for you (as others have said, from someone who specializes in betrayal trauma) can be very helpful.
Focus a lot on your own care: eating well, staying hydrated, taking walks or getting other exercise. Sleep when you can and get a doctor's help if you're struggling to sleep.
What's helping you right now? What's not helping?
Support and strength to you!