The Rebbe's guidance for those who feel lonely or isolated:
You are never alone. Recognizing that G-d is always present with you dispels loneliness (IK 5740). Deepening one's bond with the Rebbe and with Torah study, alone and with others, strengthens a person in lonely times (IK 654).
Reach out. Loneliness can be overcome by building friendships, helping others and immersing oneself in Chassidus (IK 6155). Use your abilities to serve with joy and to benefit those around you (IK 5740, 4465). Through education and good influence on others — especially children — one creates something eternal (IK 8964).
On shlichus and far from home. Even when someone working for Torah or on shlichus feels isolated, financially or emotionally, he can draw strength from his mission and keep going (IK 785). Every chassid has a mission to affect his surroundings with pleasantness (IK 4465). Feelings of isolation that lead one to doubt the path of Chassidus are tactics of the yetzer hara (IK 6895).
Seek support. When feeling isolated or troubled, seek guidance from trusted friends and keep joy in your mitzvos (IK 4438). When loneliness is tied to worries about shidduchim, reflect patiently and don't lose heart (IK 6809).
See also: Emotional well-being – Self-confidence and feelings of failure; Bitachon – Joy and overcoming sadness.