I like cooking and having people over, so it's something I do often. I have kids, but most of my friends don't, so the numbers aren't coming from big families.
If it's something that you aspire to, here's the basic algorithm:
- Learn to cook something well. It's better to master one dish, and pull that trick semi-often, than to be able to cook a bunch of stuff mediocrely.
- When you meet somebody interesting, invite them over in the next month. It's easier to do that soon after meeting them rather than, say, a year later. Feels more natural.
- Before inviting said person, check with existing friends (assuming you have a couple) to see if they're in. It's less awkward to invite someone new over if there are already going to be other people.
- Let everyone know that their friends are also welcome.
Bonus points: keep some reserve drinks around for such situations. I've pretty much always got a spare case of beer on the balcony, and a bunch of wine around.
If you don't already have a couple friends, then inviting people to your home is a little weird, but the same rule about inviting people out early applies: do it in the first month after meeting someone and it doesn't seem weird. There you can go to a bar, or do something you know you have in common.
Perhaps curiously given the above: I'm actually mostly an introvert and like spending most of my time alone. But a lot of these things do depend on your own personality and where you live.