My DW and i were having significant difficulties, including her accusation that i was having an affair.
I was not, but looking back with hindsight, i can see that a friendship with a female colleague was definitely heading towards an emotional affair. I cut contact, but the accusations remained.
Shortly after this i discovered that my DW had had a physical affair through that whole period, and several months beforehand. It had ended without my involvement.
We committed to work together to salvage our marriage, and were ok for a while, but eventually effort on both our parts fell away.
I rather selfishly blamed DW for this failure, but only internally.
This selfishness also led me to think i "deserved" something more.
In this frame of mind, i got very close to a different female friend, and this quickly turned into an intense emotional affair. We were both married, and were adamant that it could not turn physical.
After about 6 months, some proper self-reflection showed me that i was being unfair to DW, the AP, my family and myself. i ended the EA.
Several months after that, my DW found some old messages to AP, and it all came out.
DW and i were extremely honest with each other about everything that had happened, and we agreed that we both had so much love for each other, we decided again to re-commit to our marriage.
6 years on, and our experiences have made our marriage much stronger.
We are much more open with each other about our frustrations and challenges (which still occur, obviously), but we face them together.
I do not recommend the path we have taken - we have hurt each other hugely. But we each recognise this, and both work hard to ensure we appreciate and support each other.