Having been in both, literally and metaphorically, it’s a useful mantra both places
You can also use “this too shall pass” if you want a lighter version