I'm sorry you're suffering. What you're going through is part of the human condition and nothing wrong with you. I'm glad you're thinking in terms of how to change yourself to be comfortable, rather than seeking advice on how to fix the world to be comfortable for you, which is not really possible.
The basic idea is this. You have to train the mind, a bit like how you'd train a puppy, except of course that you have a lot more material that needs to be configured, so it requires more patience. When the mind comes and disturbs you about something (usually with the intent to help you be a successful animal), you do some very simple steps to soothe the mind about that issue and reduce the likelihood of the mind bothering you about that again. In this way, you gradually get more and more peace and happiness that seems to come out of you, not in dependence on worldly circumstances.
I have done a simple practice for many years that alleviates all kinds of suffering, loneliness being just one common kind. It's described well in this book: https://library.dhammasukha.org/uploads/1/2/8/6/12865490/the...
The basic idea is this. You have to train the mind, a bit like how you'd train a puppy, except of course that you have a lot more material that needs to be configured, so it requires more patience. When the mind comes and disturbs you about something (usually with the intent to help you be a successful animal), you do some very simple steps to soothe the mind about that issue and reduce the likelihood of the mind bothering you about that again. In this way, you gradually get more and more peace and happiness that seems to come out of you, not in dependence on worldly circumstances.
May you be well, happy, and peaceful.