This is the logic of unbelief, and not Solomon’s serious advice to us. It is the conclusion that the chaos of this world drives us towards, and it makes sense for the person without faith.
Why pledge yourself to a world in which the best you can hope for is the passing pleasures of sin, which abides with you only during the days of your earthly life? What about your eternal soul? Will the soul be ready to let go of life and lose everything it has lived for on the last day? If we go away from God, all we have got left is ‘eat, drink, and be merry’. Give yourself over to entertainment and forget you have an eternal soul. Forget that you must give an account to God at the end of life. Listen to the comedians, just focus on the empty superficiality you can scrape up for yourself. You will get no help from God. You will not understand the meaning and purpose of life.
Realise that you have an eternal soul, which you cannot just throw away at the end of life like an empty crisp packet. Listen to God, respect him. Recognise your lost condition. Listen to the gospel and hear the message about the Saviour who died to take the punishment for sinners. Listen to his invitation to come for forgiveness and life, and respond to that message in repentance and faith.