This is not the worst thing that can happen in a marriage - most people, especially those being left, feel that divorce is even worse. Also the death of a beloved spouse or of a child is worse. Many affairs mark a turning point in the marriage - with work the marriage becomes much better. Communication about what you're feeling is even more important in a marriage than communication about what you're thinking. One study shows that for every negative remark by a spouse, it takes 6 positive remarks to make up for it.
Couples heal by starting to talk straight with each other about their emotional selves.
A great many couples have hidden their deepest emotions, feeling that they're not important enough, or that the other person will be upset. The tasks of rebuilding your marriage are honesty, giving yourself a voice, being vulnerable with your spouse, making your expectations realistic, taking responsibility for your own actions. Forgiveness is last. In my experience, even though only one spouse chose to have the affair, both spouses have let their marriage get into disrepair. They need to assess early on where their problems are and get to work on them.