There are a few ways and they can work together. Here's a question to just consider:
"Is it generally true that, the stronger the loneliness, the stronger the desire for others to to make us feel better-- the bigger the hole in our hearts, the bigger the feeling of unworthiness?"
It can help to just question that. Is it true or not, that it feeds into itself? Does isolation and rejection get internalized into a message saying something like, "I don't have value. I'm not interesting. Desirable."? Which creates more isolation? And more internalization?
This is the way the knot is tied more and more over time in a way that's hard to untie. Just imagine now that many others have this same problem. Loneliness is a little bit like drowning in the ocean and being unable to swim next to others, who are also drowning and can't swim, but asking them for help. It would be understandable, but it would be confused. Sometimes it can work for a little bit if you get close to them and you take turns pushing off of each other for room to breathe, but it does not solve the problem. But imagine if people were too busy drowning to see that the solution was learning to swim, and instead constantly grasped at others who were drowning. I think that's the very first step: to only see this problem as clearly as possible. You don't have to solve anything, you don't have to work on anything, just see the problem itself.