King Solomon is still trying to satiate his desires to find meaning in the world, and we keep in mind that he was doing this without having a Biblical worldview, so given that Solomon was a King, he had infinite resources at his disposal, basically enough money to buy any kind of pleasure he wanted whether it was wine or women.
Ecc 2:10 And whatever my eyes desired I did not keep from them. I kept my heart from no pleasure, for my heart found pleasure in all my toil, and this was my reward for all my toil.
Ecc 2:11 Then I considered all that my hands had done and the toil I had expended in doing it, and behold, all was vanity and a striving after wind, and there was nothing to be gained under the sun.
Again Solomon concludes finding happiness through pleasure is vanity, or meaningless, as in overindulging on things like food, or alcohol or drugs, and kind of excess, is supposed to bring pleasure, but Solomon, who did all that, tells us there was nothing to be gained from it.
Very important stuff here, if we think when we are hungry and then go out and crush a whole large stuff crust pizza, after we finish eating it, do we feel a prolonged sense of happiness? Not usually, we end up feel bad and even sick afterwards. Same thing with booze, a couple of hours of howling at the moon usually equates to 12+ hours of being hung over the following day.
Happiness is not found in earthly things, as Christ tells us, earthly treasures wither and fade, but we should put our sights on what is heavenly or eternal, because those things don’t wither and fade, they are eternal.