Cheating doesn't have to end a relationship. By apologizing for what you've done and taking proper responsibility, you not only make it more possible for your partner to forgive, you can open a meaningful and deep discussion about your relationship. With luck, your apology and honesty may even make your union stronger than it was before.
Fess Up First
If it's not too late, fess up about the cheating before you get caught. This will make your apology much more authentic and meaningful because it proves to your partner that you're genuinely sorry about the cheating, not just sorry you got caught. If it's too late for this, give your partner an explanation about why you didn't tell him yourself and express relief that the secret is now out in the open. Inform him, however, that you're sorry you didn't tell him yourself.
Summarize the Situation
Give your partner a detailed summary of the conditions that lead to cheating and what happened during the affair. Be as honest and transparent as you can while still being considerate of his feelings. Avoid the messy details unless they're pertinent to something in your relationship. Emphasize negative and unsatisfying aspects of the affair and describe the process you went through mentally and emotionally in ending it. Explain any personal discoveries you've had about why you cheated, since these kinds of epiphanies often make all the difference in changing a behavior.
Explaining, Not Blaming
It's possible issues with your relationship played a role in your cheating. As part of the apology and healing process, it's a good idea to talk about areas in which you are dissatisfied or frustrated and how you and your partner can improve them. However, make it very clear to your partner that you understand that cheating was still your choice and your fault. State you should have confronted these issues within the relationship instead of going elsewhere for what you needed.
Reassure your partner that you regret the affair and want to fix things with him. Give him a list of reasons why he is the partner you want and why your relationship with him is your priority and the relationship you've ultimately returned to and want to preserve. Encourage your partner to express his feelings about your cheating and ask him what he needs from you to be able to trust you again. Give him time to process his feelings of hurt and betrayal and to decide if he can forgive you and how to do so.