If you make the decision to end a marriage to be with a lover how can you ensure you don't make the same mistakes again?

I believe that relationship problems can almost always be solved. The problem is with your attitude. It's not something external to you.

So, you could have saved your marriage, if you wanted to. If you want to hold on to your new relationship you'll be able to do that too. But if you are searching for a relationship with no problems, you will always be unsatisfied.

ANSWER

You are making a mistake to end a marriage. You made a vow, and sooner or later, you will suffer the consequences. Honor your vows and see a more rewarding future.