Actually there are few things one can do to prevent the situation in that particular area. There is no other place to build and you know that eventually you are going to get caught by flooding.
I am talking about areas that have ridgelines 1000 meters tall with a floor of only 100 meters wide, often less, with a stream you people would call a river, we call them creeks, running down the middle.
Sooner or latter there is going to be more water coming in than can go out and it is going to take everything with it when it leaves.
But you live there anyway because it has not happened to you, yet, and mama lives next door and you don't want to leave her alone cause she's old and you and everyone in the family grew up there and you just can't leave.
This is also mining territory and for some reason miners and their families get very attached to these little mining towns. Most of them were originally from Wales and Cornwall with some Italians and Lithuanians mixed in and they just stay even when the work dries up for generations.
https://www.youtube.com/watch?v=fb9AhbmPirc&t=1279s
I put in a link so you can see the geography and terrain.