If you want to be forgiven for something stupid you've done to your relationship, (cheating, emotional affairs) you should EARN it. Here are some ways to earn back your partners trust.
1. Accept that you made a mistake, and listen to your spouse's demands. Do it even if it doesn't seem reasonable (within limits).
2. VOLUNTEER to go to marriage conseling. This will save up so much trouble and drama. You don't want drama.
3. Never be a know-it-all in this type of situation. Don't pretend you know why this happened and how to avoid it. You don't. You got caught cheating and now you must face the music.
4. "I did it because you didn't do X for me. I had to get X from somewhere else. It's not my fault I" anything that sounds remotely like this is the most pathetic thing a cheating spouse who got caught can do. I'm guessing you've all seen this on an episode or two of Cheaters (the show with Joey Greco).
5. When participating in one of the activities your husband or wife has planned, don't "drag your feet" or be constantly letting her know how horrible the experience is and it's not affecting anything. That won't help and build up even more negativity between both of you.
6. Remember anytime that you both were enjoying your time together, and recreate that moment. Enjoyed a trip together? Go on a trip together. You may even consider booking a couples retreat, specifically ones to help couples suffering from midlife crisis.
7. Don't assume your spouse will forgive you. Some husbands and wives stick to bad relationships for the sheer love of their children.