eat healthy, have a job, go to the gym, hang out with friends
Cook a healthy meal and share it with other people. Meals are a perfect time to socialise. I met my partner at a Christmas lunch a decade ago for example.
Find a job where you interact with other people, avoid jobs where you sit in a home office all day by yourself.
Personally I think gyms are terrible. Some sort of sport (even just group running) is more fun, a better workout because competition will drive you to work harder, and you will meet new people.
Don't just hang out with friends. Encourage everyone in your social circle to invite new people into the group. Most of them won't be a perfect fit and will naturally orbit out, but a few will stick.