In proper market economies, that scarcity should lead to more and more construction. Cities should be expanding, right? So to fix the issue, you need regulation that reduces the incentive for real-estate hoarding as an investment vehicle (maybe more serious property taxes on residential real estate that is not a primary home) and you need easier supply of new construction with more government involvement in expanding cities/towns by building infrastructure to support them.
Another issue is healthcare - 90% of your healthcare expenses are incurred the last 10 years of your life. Your two systems of choice are either universal supply of the most basic healthcare (definition of basic expands with the wealth of the country you are in), or privately funded advanced health options for those with life-threatening conditions. The US has the latter, most countries have the former. The biggest problem there is burnout and harder to scale supply of health workers relative to the ever-higher demand. The scary thing here is that governments with high retirement and healthcare debt to their seniors have an increasingly strong incentive to reduce that debt. Pandemics, wars, autocratic silencing of opposition all help with that. In the US where 401k accounts hold the retirements, the stock market will struggle to provide all the returns expected of it. In countries where government provides the pension, the squeeze is on government debt and thus even stronger when yields on that continue to rise (as they do now in Japan).