Ecclesiastes 7:15

In good times, enjoy good things, but beware of an evil time. For just as God has established the one, so also the other, in order that man may not find any just complaint against him

Other versions

King James Version

All things have I seen in the days of my vanity: there is a just man that perisheth in his righteousness, and there is a wicked man

English Standard Version

In my vain life I have seen everything. There is a righteous man who perishes in his righteousness, and there is a wicked man who prolongs his life in his evildoing.

New International Version

In this meaningless life of mine I have seen both of these: a righteous man perishing in his righteousness, and a wicked man living long in his wickedness.