Rejoice, O young man, in your youth, and let your heart cheer you in the days of your youth. Walk in the ways of your heart and the sight of your eyes. But know that for all these things God will bring you into judgment.
These may be some of the most sobering words of wisdom Solomon penned. They could also be the most dire warning in all of scripture. Why? Solomon literally lived them to the hilt. It is apparent that he regretted doing so. In Ecclesiastes he explains his quest to know all possible pleasure, have all that life gave, squeezing every bit of earthly pleasure that came his way. And in the end it was a bitter and empty pursuit (see Ecclesiastes 11:10).
What's more, every selfish action and desire has come under God's scrutiny. Solomon found the life that had everything, ended up with nothing. and then would face the Creator at judgment. This was a bitter reality for Solomon, one that no earthly pleasure could buffer. In essence, he did everything he ever wanted, but found it all unfulfilling in the light of standing before God to account for his life.
And so the book encourages us to "remember" our Creator (Ecclesiastes 12:1) and to "fear God and keep his commandments" (Ecclesiastes 12:13). For everything will fall under the perfect judgment of God Who misses nothing and rewards justly (Ecclesiastes 12:14). That wisdom is the best framework for life of all the possible choices we could make. That conclusion is from the guy who tried them all.