成语 and 俗语 emphasizing adaptation
people or generations to adapt to the given situation or environment


靠山吃山，靠海吃海


People who live near mountains make a living in the mountains,  people who live near the sea make a living in the sea

Notice: 靠 here doesn't mean depend on. It means lean against = near; close to

因地制宜


根據環境的實際情況制定相應的辦法 - Formulate corresponding measures according to the actual situation of the environment

When a group migrated to a new place, they have to adapt to the environment and adjust their way of life. That's 因地制宜.
For personal situation:
執生

何谓执生: 简单而言，就是「随机应变」，「伺机行事」。即在事前没有准备或临时有变时，要懂得灵活异变。


To put it simply, it means &quot;acting according to circumstances&quot; and &quot;waiting for opportunities.&quot; That is, when there is no preparation beforehand or when there is a temporary change, you must know how to be flexible and make necessary changes.

執 = hold = be mindful of
生 = unfamiliar (element)
執生 = caution and prepare to react
~
穷则变，变则通
Adapt when options are exhausted. The problem will be solved if you adapt