禍福相依

祸福相依
huòxiàng

fortune and misfortune are interdependent (bad things can lead to good results; good things can lead to bad results)

Wiktionary

Entry Composition