Ecclesiastes 7:14

New Living Translation
Enjoy prosperity while you can, but when hard times strike, realize that both come from God. Remember that nothing is certain in this life.

English Standard Version
In the day of prosperity be joyful, and in the day of adversity consider: God has made the one as well as the other, so that man may not find out anything that will be after him.