Most people are under the impression that infidelity always leads to the break-up of a relationship. However about 50% of relationships do survive affairs. The difficult thing is to heal after the affair and it's not an easy road. It's full of pain and mutual distrust for many years sometimes. The important thing, the first and most important thing is full and honest disclosure.
If your partner keeps catching you with secrets and lies, your relationship will be doomed. So full and honest disclosure is the first step to healing. The second step is what I call the no contact contract. Meaning contracting that you will not contact your prior lover at all and that often means that you have to go through extraordinary measure to avoid your former lover. Meaning you might have to relocate to another city or quit your job if this was a work place affair. This is very important because continuous contact with your lover will jeopardize the health of your relationship. And the third step is then rebuilding trust and that takes time. And that has to be quality time together. A lot of time I advise that couples take a vacation together, that they give each other undivided attention.
A minimum 15 hours per week of a 1 and 1 conversation which involves a lot of empathetic listening and understanding. Even with all of that it doesn't mean that your relationship will survive an affair. However, these three steps will guarantee that you will give it the best possible effort. Obviously if your infidelity was just a one night stand, it is much easier to recover your relationship from something short-term that it is from an ongoing deeply involved affair. Often those affairs that involve substantial investment of time and resources damage the marriage in irreparable ways. While those one night stands, meaningless casual liaisons can often, although still be damaging, can often be non-consequential to the marriage in long term.