This is the main problem. Solution is simple: Allow more new construction, lots of it.
Local people have voted against their own long term interests, if they have voted for politicians who have opposed new construction.
It is easy to succumb to short term selfishness: "I already have a home, so I don't want any new construction near me. I oppose building new homes." But in time, every one of us will need to move to a new home. Then you will start to wish that if you had supported building new homes, it would be easier for you, too, to find a new home.