1. You aren't a failure. You're not. Neither is the other person. The planet has seasons, so does our lives. Being at peace with the "winters" and dead moments in our journey takes work and once we've worked, we've grown. So see this as an opportunity to do some social, emotional and psychological house cleaning.
2. Deal with betrayal. Whether the person cheated on you or not is kind of a mute point. The person who does the stabbing doesn't feel the pain that the person who was stabbed feels. So expecting the other person to genuinely care about your feelings is not happening. Healing takes work. But once you've worked, you've grown!
3. Invest in the future. If you have kids, you guys need to be mature enough to do what is best for them. Kids need to understand that they aren't a battleground for disagreements or revenge. Don't use your kids to hurt each other, it's distasteful and honestly do you really want to be the subject of someone's counseling session? I say if my kids are going to sit on a sofa they won't be talking about me.
Side note: And don't make your kid your new spouse. A lot of mama's boys and daddy's girls are created by unhealthy relationships (not even pedophilic, but emotionally wrong) with parents. Let your kid grow up and not have the burden of being their mom's new husband or dad's new wife.
4. Go Do Something. If you're blue, go do something. Don't bury yourself in your work or denial, but do something new to get you experiencing life. You'll meet yourself again. Depending on how long you were married, you may have forgotten how awesome you are.
5. No Jealousy. Yes, your FeX or ex may be out there giving it to everyone and anything that walks and dragging themselves distastefully into the ground. As long as they do not involve your kids in their grossness or in their moving on, you shouldn't think about it. You shouldn't compare yourself either. Just because they did not love you does not mean they can't love someone else or that you are incapable of being loved. You're no longer together, it's for a good reason.
6. Close the Chapter. Move on. If you're separated, get that divorce or get back together. Don't drag it out for years. Take that relationship to the guillotine! Once you've made your decision, it's time to jump off that cliff and fly into the unknown abyss of your new and probably awesome life.
7. Get Support. I'm independent but when you're going through something like this, you need support. Lean on family and friends appropriately. Don't be an energy vampire, but it is ok to talk to your sister for an hour about some BS that happened and Oh, my God... blah blah blah. Just don't have your life take over theirs. Also make sure you show appreciation to your support network. Surprise them with some flowers or something once in a while to show them you're grateful to have people around who are holding you up as you limp through this social, emotional and psychological minefield.
It's a hard choice to make if you've been married a while, but sometimes it's better to just do it than live in misery forever. Relationships should not be jails, they are the playgrounds of our social and emotional development. Treat each other with mutual respect and put your children first... if you can do that, everything else will be much easier.