It does not matter if you cheated or if your partner did, both of you will need to work on your relationship if you really love each other and you want to stay together.
The most obvious step that both of you need to take is to be honest with each other. Now that the dam broke, you should get rid of all the excess water. Confess anything that you think might come up later to ruin your relationship, but never be too vulgar or harsh with your stories. It means that there is no need to tell what that person was like in bed, or how exactly you did it. If you feel the need to compare that affair with what you have with your partner, always be positive. Remember that you are making a confession to fix your relationship, not to ruin it.
Obviously, you should not get in touch with your lovers. Delete them from your Facebook and phone book, and if they try to contact you, neglect their messages. You need to cut all of them out of your lives. If you found your lover(s) on a social site, then cancel those accounts for good. It shows that you are ready for a fresh start.
It might be harsh to hear, but cheating is always both partners' fault. If a third one is needed, then there was something wrong in the relationship. Find out what it was and solve those problems to prevent an affair in the future. It was probably have to do something with your sex life, as well, so you need to focus on it, and you need to reconnect emotionally to have the sex that you enjoyed so much when your relationship began.
These steps show your commitment and your willingness to do everything for each other, but if these are not enough, then you might need to see a therapist a couple of times.