The best thing you can do for that problem is to give people every means to contribute to society and earn money for that contribution. And for those few (VERY FEW) people who have nothing to contribute, having a free society with growing capital and cheap goods makes it easier for their families or charities to help them out.