Ecclesiastes 7:16 in the King James Version
Be not righteous over much; neither make thyself over wise: why shouldest thou destroy thyself?
Context
15 All this I have seen in my days of vanity: there is a righteous man who perishes in his righteousness, and there is a wicked man who lives long in his evildoing.
16 Don’t be overly righteous, neither make yourself overly wise. Why should you destroy yourself?
17 Don’t be too wicked, neither be foolish. Why should you die before your time?