Ecclesiastes 2:26

24 Nothing is better for a man than to eat and drink and enjoy his work. I have also seen that this is from the hand of God.

25 For apart from Him, who can eat and who can find enjoyment?

To the man who is pleasing in His sight, He gives wisdom and knowledge and joy, but to the sinner He assigns the task of gathering and accumulating that which he will hand over to one who pleases God. This too is futile and a pursuit of the wind.

Do read the surrounding verses too, because the context often says more than a single verse.

Compare

BSB
To the man who is pleasing in His sight, He gives wisdom and knowledge and joy, but to the sinner He assigns the task of gathering and accumulating that which he will hand over to one who pleases God. This too is futile and a pursuit of the wind.
KJV
For God giveth to a man that is good in his sight wisdom, and knowledge, and joy: but to the sinner he giveth travail, to gather and to heap up, that he may give to him that is good before God. This also is vanity and vexation of spirit.
WEB
For to the man who pleases him, God gives wisdom, knowledge, and joy; but to the sinner he gives travail, to gather and to heap up, that he may give to him who pleases God. This also is vanity and a chasing after wind.
ASV
For to the man that pleaseth him [God] giveth wisdom, and knowledge, and joy; but to the sinner he giveth travail, to gather and to heap up, that he may give to him that pleaseth God. This also is vanity and a striving after wind.
DARBY
For he giveth to a man that is good in his sight wisdom, and knowledge, and joy; but to the sinner he giveth travail to gather and to heap up, that he may give to him that is good in God's sight. This also is vanity and pursuit of the wind.
BLB
For to the man who [is] good in His eyes, He gives wisdom and knowledge and joy; and to the sinner He gives the task to gather and to heap up, to give to the good before the face of God. This also [is] vapor, and a striving after the wind.
ÅB
For det menneske som tekkes ham, gir han visdom og kunnskap og glede; men synderen gir han den umak å sanke og samle for å gi til den som tekkes Gud; også dette er tomhet og jag etter vind.
OTB
Til den som behager Ham, gir Gud visdom, kunnskap og lykke, men til synderen gir Han oppgaven med å samle og lagre rikdom for å overlevere den til den som behager Gud. Også dette er meningsløst, et jag etter vind.
B1930
For det menneske som tekkes ham, gir han visdom og kunnskap og glede; men synderen gir han den umak å sanke og samle for å gi til den som tekkes Gud; også dette er tomhet og jag efter vind.

Study notes (Tyndale)

Original text and word study

Cross references