any advice to ease post-breakup second thoughts or anxiety?

I broke up with my boyfriend (long story short we were together for a year and a half but the relationship started getting unhealthy and I can feel that he doesn't know who he is and he has a lot of emotional baggage that causes him to do negative actions and he did thoroughly apologized, but I didn't give in to going back to him because he has apologized before but the emotional baggage is still there, and everything after I broke up with him and I do want him to be happy although it does feel kind of good that he chases after me, at the same time I feel his pain and feel bad for him:/) and I've been A LOT happier after the breakup but occasionally I have selfish thoughts about why I should have stayed with him. I Just wanted to take a chance to see if there's anybody out there who can help me straighten my head out or motivate me :) thank you for taking time to read this I know it's confusing😆