Loneliness comes from believing that people are deciding to not spend their time with you. You get disappointed. You get hurt. Quite irrational really. How do you cure it? You disappear. You remove the expectation by not putting your social presence out there. You remove the hope. You remove the vanity. So, you don't get hurt. You don't get disappointed. You end up being contented and alone but not lonely.