You have liberated yourself from him, but this attachment, destructive dependency and the wounding remain.
This is why you need to work on your healing, rehabilitation, and growth from this past experience, otherwise, you will self-sabotage again whether it happens to be with this person or other people like him.
Please, look for a professional psychotherapist with expertise in relationships, abuse and mood disorders, ideally a marriage and family therapist, with an integral/integrative psychotherapeutic approach, this is a professional who would not adjust you to their way of work, but adjust themselves to your needs, personality, and expectations. Psychotherapy will support your healing and enable you to grow and empower yourself from this painful situation.
Your social network and support system need to play an active role here. Having a couple of healthy, mature and caring persons in your life, could make the difference between you self-sabotage and healing yourself with the right support. here is where your close friend plays a role, but you also need to work on expanding this support system to empower yourself and your life. Does it make sense?