Hi Lonely, it is hard. Even though you know you're doing the right thing it doesn't stop you being lonely. We just can't have relationships with toxic people and still keep our self-esteem.
I'm quite shy myself, so I suggest you get out by joining something where you do an activity, say hiking or a class. It's much easier when you have something to talk about.