It can't be done really. We've been trying to for decades, but famine isn't caused by a lack of resources, it's caused by political problems. Western nations have been sending food and supplies to impoverished African countries for ages, and it just gets stolen by their leaders and doesn't make it to the people who need it. The only way to fix this is to militarily invade and occupy these countries so we can run them properly, but we can't do that because it's imperialistic.
The fundamental problem as I see it is that there's a huge amount of undiagnosed sociopathy in human societies, and most of them are run by people with at least some degree of sociopathy, because they're uniquely skilled at working their way into those positions. The only way I see to fix this is to genetically engineer humans to remove this problem and make them more empathetic. This fix would then have to be forced on everyone somehow, perhaps with a virus.
[1] https://news.ycombinator.com/item?id=14205938
[2] https://carcinisation.com/2014/07/13/an-anti-deathist-f-a-q/
Rich countries sharing the wealth with the poor, investing your money in banks which don't fund exploitative and harmful projects, changing how you travel etc. This is the work that also has to be done by each of us.
We always seem to lean on developing new technology to solve our problems and technological development is wonderfully successful, it's a good thing, a fine thing, but we don't use it very well. For example everyone on earth could be fed, but that's not how we operate. It's all common sense though really.