Most rural towns were built to serve surrounding farms and ranches. As farming became less labor-intensive, the need for those towns went away, and the towns slowly died. See "Depopulation of the Great Plains"[2] It's interesting to note that the depopulated area is the best part of the US for wind power. That could work out OK.
Mining towns die when the resource is exhausted. They go fast.
Japan, where the population is rapidly declining, has a large number of empty rural towns. There's an incentive program to get young people to move there, but not many are interested. Because Japan's infrastructure is centrally funded, much of the infrastructure is still maintained in areas with very few people.
Russia has a declining population and entire abandoned cities. Putin is pushing young people to have kids. There's a "Pregnant at 16" TV show in Russia, which has been re-branded to encourage pregnancy.[3]
The countries that are above breakeven (2.1 children per woman) are all in Africa or are dominated by religions which oppress women. And poor.[4] "Peak baby" was in 2013 worldwide.
There are two futures, both bad. "Keep 'em barefoot and pregnant", or "Will the last one to leave please turn out the lights."
[1] https://en.wikipedia.org/wiki/Lists_of_ghost_towns_in_the_Un...
[2] https://en.wikipedia.org/wiki/Depopulation_of_the_Great_Plai...
[3] https://meduza.io/en/feature/2024/11/05/as-russia-targets-ab...
[4] https://en.wikipedia.org/wiki/List_of_countries_by_total_fer...