Ecclesiastes 7:18

Amplified Bible (AMP)
It is good that you take hold of one thing (righteousness) and also not let go of the other (wisdom); for the one who fears and worships God [with awe-filled reverence] will come forth with both of them.

Read Ecclesiastes 7:18 in other translations