You want advice on how to do this? It's called go see a therapist.
If you're purposely sabotaging relationships, more than likely you really are in need of professional help and guidance. There's no shame in going, no magic pill to make you better. You need to sit down with someone and have an honest heartfelt conversation with yourself about why you are doing this to yourself. Along with that they can provide you with exercises (emotional/mental), guidance, point out flaws in your logic, and help you generally be a better you. It might not be cheap, but if this is something that is truly important to you how can you think of spending money to better yourself as too expensive?
"Well, then," the Cat went on, "you see a dog growls when it's angry, and wags its tail when it's pleased. Now I growl when I'm pleased, and wag my tail when I'm angry. Therefore I'm mad."