I have been on the other side of it, back in my early 20s I was that toxic person.
Only child, and a rich kid, so didn’t think I needed to work, ultimately I realised I was carrying a load of divorced parent baggage around with me.
I was with a girl, actually a series of girls, but one in particular that I treated like garbage. Everyone around me could see it, but I didn’t.
Eventually she saw the light and got rid of me in a highly public and hurtful way, I completely deserved it. At the same time the rest of the friend group basically ghosted me (I never knew if it was intentional or not.) Again, I absolutely deserved it.
In hindsight, it was the best thing, I needed the wake-up call, after a period of depression, I got on with life, moved towns and treated people a lot better.
I carried the regret around with me for a long time. I lost people that would have been lifelong friends. But the lessons learned set me up for life.