Having good friends who are nice, share interests and are willing to talk always helps. Honestly when I feel lonely I end up coming online to talk to friends on
TH. Sometimes when the only friends you have are being difficult, you might prefer being alone to avoid the hassle, but still wish you had company. Maybe try to find some people you really enjoy being with and spend time with them when you feel alone.