I am truly sorry for you girl, I understand the pain and sympathize.
You are not the typical Wayward and your exH is not your typical BS, he brought infidelity to your relationship as well.
If this can help you gain insight, think about the kind of bond you 2 developed, because it might be a trauma bond as both of you betrayed each other, so you may carry similar issues from the past that doomed you while you were unknowingly experiencing the perfect storm (similar to the kind of relationships one develop with an AP, even if you ended up marrying).
I can wish you to succeed in working to resolve your issues and improving yourself, the kind of attachment can really change with work, and if you will develop secure attachment you will not feel the need of cheating anymore, nor choose someone who carries the same red flags.
You are still young to rebuild after you build yourself, both of you may become happier people with work (assuming he is putting in the same effort as you).
The thing you need to put attention in my opinion, is rebuilding boundaries. When you crossed a boundary is way harder to respect it in the future than when you never allowed yourself to do it.
Even once, it permanently breaks that compass. So work on creating new, ironclad boundaries that you will never cross or allow to be crossed by anyone else.
Just remember, they must not be walls, they must be a very well guarded door.
I wish you relief.