24a There is nothing better for a man than to eat and drink and tell himself that his labor is good.

Here is another translation based on the Hebrew text.

There is nothing more pleasant for a human being than to eat and drink and go forth and make the soul agreable for labor.

 

24b This also I have seen that it is from the hand of God.

Here at the end of the 2nd chapter of ecclesiastes, el-o-heem’ enters. We are told ‘this’ is from the hand of God. ‘This’ refers a lifestyle of finding it good and pleasant to eat, drink, and work. It is good to find contentment in what we have and not in the accumulation.

 25a For who can eat and who can have enjoyment without Him? 26a For to a person who is good in His sight He has given wisdom and knowledge and joy,

Who can have a content life separated from God? God blesses the one who is pleasing in His sight. Wisdom and knowledge have been paired in the past, here God adds שִׂמְחָה (sim-khaw’ – delight, exceeding joy, festival, gladness, happiness, joy, mirth, pleasure, rejoice, rejoiced, rejoicing) to the blessing of wisdom and knowledge.

26b while to the sinner He has given the task of gathering and collecting so that he may give to one who is good in God’s sight.

‘Sinner’ is וְלַחוֹטֶא֩ to miss, go wrong, sin. The one who goes astray has the task of gathering and collecting to futility. God give to the person who is agreeable in His sight. Of the ways one can go about life, The one traveling by the light is agreeable and pleasant to God. When we go about life wisely, we are given increase in wisdom, knowledge and joy, while the foolish walk in darkness and misses agreement with God.

26c This too is vanity and striving after wind.
The vanity here relates to the luck of the draw as to who becomes agreeable to God and who offends.
Scripture quotations taken from the NASB. Copyright by The Lockman Foundation (NASB®)