I think some of it is just practice, although maybe I'm just a natural loner. I think being an only child kind of prepares you maybe. But, I've lived alone for over 20 years. I've worked from home and alone the past 7. It's more the other way around for me. I dread having to be around people.
I suppose weirdly- consistency helps. I can feel weird if I've been in a social situation that went ok (which is rare now,) but then go back to being alone.
I pretty much constantly have distractions on in the background during my waking hours. I also just learnt to embrace the freedom of it. You can eat when you want. Leave chores till the next day. Watch what you want, buy what you want. I enjoy those freedoms.
I used to be more dependent on others. I valued my friends and family greatly and, needed them greatly. I suppose enough of being let down or left, one way or another- be it through unavoidable things like death and moving away or, just priorities and lives changing made me start to realise I could only really depend on myself. The risk of being hurt made the prospect of trying to find new friends seem not worth it.
I do still have people I would miss texting/ keeping in loose contact with. Here fills a lot of my social needs too. I indulge in maladaptive daydreaming for romantic needs. I'm lucky really that I don't tend to get that lonely. I worry that might change one day but maybe I'm just different. I don't think it's normal to want to shun people this much!