Around 10% of houses in the US are vacant, although I'm sure a fair amount are that for good reasons (shitty locations, old and worn to high hell). This to me sounds like a resource allocation problem and not a lack-of-resources problem.
Energy could be free close to free if we made the right choices. The sun's right there. Unfortunately, we've been stuck in a political rut for a long while, making long term projects like 'do something about global warming' and 'transition away from fossil fuels' uninteresting.
Many medicines are only expensive due to patents and making up for research costs. Actual production is usually cheap as hell.
I don't have all the answers. People smarter than me might have them. But I do know that we can do better.