I think when you've realized that you don't particularly enjoy being alone - the best cure is to avoid it; and try to get more friends.
Friends are made by doing something together, regularly, over time.
I wouldn't call this "get a hobby" - I'd call it "find something to do".
My best suggestion is start doing some kind of organized training like martial arts, or some team sport. Find somewhere to volunteer: food bank, volunteer programs teaching kids to code, anything in your area that you can relate to.
I'm not suggesting that it easy or trivial - but I also believe it is the only way.