Honestly, I am in a very similar situation.
The truth is that the human being has a great capacity for adaptation, and you get used to everything, even loneliness.
It is normal that when you are depressed, discouraged or sad, those ideas come to your head. Also happens to me.
But in the end, after many experiences, it is better alone than badly accompanied.
You will avoid, betrayals, false friendships, lies and disappointments.
However, if you want the situation to change and socialize, it is very difficult when you are locked in, if not impossible. Unless you start doing it online.You could try to sign up for some type of activity that you like and that involves knowing people. For example, cooking classes, painting, dancing ...
For example, I have come to know people, thanks to the fact that I force myself to go out, at least to walk my pets and conversations arise with other people who also have animals. They are not friends of course, but at least I have interaction with other human beings.
Good luck and do not get discouraged.