Recognizing that you're doing this (any of this kind of self-harm in any form, relationships to others or to self) is the largest first step. Once through that step, the "rewrite" of the script is wide open.
I think it is very hard, and take a lot of courage. So
@shimmerz, huge respect for what you're doing, and everyone else working this stuff.
Asking:
1. What do I (and any good person trying to do life right) deserve? What would God or my dog want for me? What would I want for me if I were my BFF? Tough to answer this when you've gotten mostly crappy others growing up, so be willing to imagine a better world.
2. What would a better future, job, relationship look and feel like? Envision it, find photos online of it, dream it, talk about it, make it real. This step can be really hard for some people, and can go into fantasy for dissociators.
Often, there is a need to loop back and do the first (what have I been tolerating that does not make my life better?) and #1 and then revisit 2 as often as practical.
3. Research and take action. Take small steps to become your true self, which you alone recognize, but those who love you and support you will encourage. Take help when offered by safe others. Ask for help on daily small tasks to support your vision and actions. Get a buddy to help you stay on track; use whatever you have and love, even a forum or a YouTube video person you find inspiring and take a daily dose.
4. Be positive and focus on your past accomplishments and future potential. Don't wallow in failures and mistakes; they happen to everyone.
Be honest with yourself and others about your toughness and how far you've come. There is no shame in creating a new life from the ashes. Only shitty people would be aversive to someone rebuilding their lives. Ditch em now.
I know this sounds "advice-y" but it's how I move forward and away from those who are toxic or narcissistic. I also ask, if I can't be my true self (selves) at least 75% in front of this person, then what's the point of being with them? If they are my boss or neighbor, that's one thing, but not for optional relationships.
Finally, there is nothing wrong with keeping acquaintances at a further distance that in the past when one was hurt, and there is no problem being cautious and testing out the territory when it feels safe.
As in physical fitness, so is emotional/relational. There is no "going back pre-injury" only forward. Go in love, and do your best. Love yourself every step, all the way. Get good help, and be willing to deal with setbacks and new realizations about how TERRIBLE it actually was back then, and how different it is now. No problem with that.