It's not that mysterious, lots of other countries manage to do it fairly well: You create a minimum standard of living and help anyone that falls below that. A social safety net. If you have no place to live, the government provides you with a relatively good alternative (not homeless shelters – those places are awful). If you don't have enough to eat, the government gives you food or money to buy it. You make sure newborn babies have food and care. You set up a system of laws that make sure companies provide time for parents to take care of their newborns. You make it easy and relatively cheap for parents to find early education options and child care. You give people healthcare so they're healthier as adults. You provide options for mental healthcare to help people avoid violence. All of this stuff raises the quality of life for everyone.