I used to think that way when I didn't have a steady girlfriend or fvck buddy but that was when I was an AFC and didn't know a damned thing about how things really work.
Kurt Cobain really had it right in his song "All Apologies" when he sang "All alone is all we are".
That person by your side can leave you in the blink of an eye by betraying you or getting killed in an accident or their family forcing them to move away etc.
Also when you and anyone dies we all die alone.
No one can experience our unique death with us and hold our hand and exit this world with us.
We are all truly alone.
The trick to defeating the sadness of that fact is to simply acknowledge the truth of it and let time and your continued efforts at acceptance of the truth dull away the pain.
I think in some circles this is referred to as existentialist horror.
I've read tons of stories about successful people having all the social interaction that anyone could ever want, tons of friends, girlfriends, basically whatever they wanted yet they always felt like the loneliest person in the world. They got over the bad feelings of it by doing what I said and also embracing their own reality of how they should feel to replace what they naturally felt about feeling alone. Crazy as it sounds it worked for them.
I wouldn't be surprised if the people I read about used NLP to overcome this feeling.