You dust yourself off. You have a good rant about it to whichever poor friends will listen and a good laugh with the very best of them who will have time for you. You will remember all the things he did to annoy, irritate, belittle and infuriate you and generally waste your time. You will be furious, you will be sad, but then you'll eventually only be filled with pity for them, relief, and a sense of freedom. You will acknowledge that the whole thing was really a blessing in disguise. You'll know full well that you can do so much better than this, and you'll resolve never to settle ever again. And, of course, you'll be aware that compared to your other problems, this, this is nothing.
And if all that fails, you buy the most fabulous pair of shoes that you can afford.
And the shoes may screw up your feet, but they'll never screw you over, and the shoes may break your ankle, but they'll never break your heart.
And then you let it go.