The first thing to do is stop with the "repair" thoughts.
As Bonnie Raitt sang, "I can't make you love me if you don't".
The first step is to accept the other person wants to move on.
The next step is to (remember) each of us selects our own friends, lovers, and spouses.
Whatever happened between you came about because at one point in time you both said "Yes".
This means YOU have the power to select a NEW person.
Since we have over 6 Billlion people walking the planet my guess is there is more than one woman who would find you to be exactly what they're looking for. I did a post on "Closure" you may want to skim through it when you're ready.
Best of luck!