Ecclesiastes 2:3

Amplified Bible (AMP)
I explored with my mind how to gratify myself with wine while [at the same time] having my mind remain steady and guide me wisely; and how to take control of foolishness, until I could see what was good for the sons of men to do under heaven all the days of their lives.

Read Ecclesiastes 2:3 in other translations