It’s stressful enough to struggle with problems in your marriage, but an affair with someone else can devastate your relationship. Infidelity has great power to wound both you and your spouse, regardless of which one of you has been unfaithful.

But an affair doesn’t have to kill your marriage. Not only can you keep it alive, you can even build a stronger relationship than you had before the affair. Here’s how:

Understand what caused the affair. Realize that the affair didn’t just suddenly happen, and it wasn’t caused simply by an external circumstance. Know that brokenness in your marriage created the pressure that, over time, led to the affair. Identify which of these common risk factors contributed to the affair: communication issues, character development issues, conflict resolution issues, adult life stages or landmarks, and confused or broken choices. Consider which of these needs you and your spouse have failed to meet for each other: affection, sexual fulfillment, conversation, recreational companionship, honesty and openness, physical attractiveness, financial support, domestic support, family commitment, and admiration.

Think about how you and your spouse’s backgrounds (including family of origin, peer group, and dating relationship dynamics) have created dysfunction that needs to be healed. Don’t place the blame solely on the offending spouse; recognize that both partners have contributed in some way to a broken marriage, and take responsibility for your own part in the problem. Recognize that once you understand what caused the affair, you can begin to focus on healing specific aspects of your marriage that need attention.

Fully and honestly reveal details. If you’re the one who had the affair, ask God to give you the courage to disclose details about it to your spouse. Know that doing so is an important turning point in restoring intimacy to your marriage. Consider revealing the details during a counseling session so a professional therapist can minimize damage and maximize healing as you discuss what happened.

Focus on the facts and be sure to reveal information about: who the affair was with, what happened, when it happened, where it happened, the current status of the affair (whether it is ongoing, terminated, or in the process of being terminated), and who else knows about the affair. Keep the circle of people to whom you disclose the affair as small as possible – only as large as is necessary for healing to occur.

Set some basic goals. Recognize that, although your dreams for your marriage have died, they can be resurrected. Think back to a time when your relationship was good, and believe that it can be even better in the future if you both pursue healing. Clarify your commitment to each other, your marriage, and your family. Decide to work together to get through the crisis, stay together, and build a solid future as husband and wife.

Strive to understand and be understood. If you’re the one who had the affair, try to listen to what your spouse has to say without defending yourself. If you’re the one who remained faithful, try to speak to your spouse without offending him or her, sharing your thoughts and feelings instead of attacking your spouse. Do your best to understand your spouse as you both identify and confess your personal responsibility.

Continue to live together if possible. If either of you threatens the other’s well-being, consider a separation to provide space for the healing process. But if neither you nor your spouse is combatant, continue to live together while you work through the crisis. Tell your children something appropriate by joint agreement, such as that you’re upset about an adult problem, but are trying to solve it. Get tested for sexually transmitted diseases, and take good care of your physical health, such as by eating, exercising, and sleeping well.