This is why people say, "Either companionship or death" (Taanis 23a).
The Talmud quotes this aphorism after relating the story of Choni, who awoke after a sleep of seventy years, and, because everyone whom he had known had died, was totally without friends. When he found that no one of the new generation appreciated him, he prayed for death as an escape from an intolerable existence.
One does not have to sleep for seventy years to be alone. Many people are "loners," deprived of the comfort of sharing their lives with others. Much of their loneliness may be self-inflicted.
Withdrawal from human contact is invariably caused by a negative self-image. People who think poorly of themselves assume that others will not welcome them and in fact that they will reject them. To avoid the pain of possible rejection, they simply withdraw from human contact and retreat behind a wall of isolation that they erect to keep people away. Unfortunately, such a wall is not only a barrier; it becomes a prison.
I dealt with this subject in my book Let Us Make Man (C.I.S. Publishing 1987). There are ways that we can overcome the negative self-image, but before we can implement such techniques, we must be aware of the problem: we have indeed isolated ourselves due to faulty self-perception.