Loneliness is a feeling usually experienced when one doesn't get like minded company. It is the attitude of a person that makes him feel secluded amidst many people. A relationship is established when there is a common need between two persons. People waiting for a bus or a flight or a train get together when the waiting time is more.
Old people ususally get the feeling of loneliness as no youngsters would have the same thinking values they have! Thus in old age the problem is more severe as they find it difficult to get the same age group. Even if the people of the same age group join together, they won't be really together unless they can share common issues.
Employees in an organization form into different groups and each group will have a common interest. It is the common interest that makes a company.
Those who belong to the same faith will be together. There are some who are contentended and are busy with their own self analysis and study of nature. They are always busy and happy without getting the feeling of loneliness. A bhakta is always in unison with the Divine and thus never lonely. He would never feel lonelines whether he is alone or admidst an unkown crowed! Those who take to contemplation on the Divine are never alone!
Great personalities set examples of how to be always in the company of the Divine. Performing a mantra japa, analysing the 'Mahavakyas' like 'Tatvamasi' or questioning 'who am I' or trying to be subservient to the Almighty and seeing His hand in ever activity in the world will help.
Loneliness ends in the thought of the Divine. Let's be in the company of the Divine and be happy always.