Once those cities are unaffordable for the very people you mention, they will just move to more affordable places where they have a better cost of living, and then they will bring ideas, creativity, and resurgence to these areas and make them better.
If you're a critical worker, then surely you can demand a pay raise. If not, move. If somebody can replace you, you're not critical. If somebody can't replace you, they'll have to pay more.
I'm not dismissive of the cost of these cities at all, nor the plight of those living there, but you get what you pay for. If you're a teacher in New York and you can't afford rent, move somewhere else instead. What else are you going to do? Rent control? Then you just have people who can never afford to build lasting wealth because they will just rent for life.
There isn't a 'solution' to this 'problem' because it's just a basic fact of human organization. I'd love to live in Colorado, maybe Breckinridge, but I can't afford that. So I live somewhere else and visit. Does that suck? Yeah sure, it also sucks I can't buy a Ferrari.
Ideally we want mixed-use development neighborhoods with differently priced homes for people with different income levels to live in. But it looks like without the government enforcing it, that isn't going to happen.