One of the most difficult things is to rebuild your partner's trust after an affair. One of the first things one must do is to terminate all contact with the lover. Now this might require relocation or job change. It might require very drastic changes in your life.
It's very important. I have couples usually sign a no contact contract to make sure there is absolutely no contact via text or email or Facebook with a prior lover.
The next thing is to spend as much time as possible with your spouse or your partner. Undivided attention is key. That may require that you account for all the time away from your spouse, because it may take time for the aggrieved spouse or partner to start trusting you again.
And of course, it will take time. It will take heartbreak. It is not something that's rebuilt over night. It is simply something that requires continuous proof of devotion and remorse, and so, it's not something that is going to happen quickly.