In the book of Ecclesiastes, the author uses the word meaningless, but the original word(hevel) would be closer to smoke or a vapor that disappears when you try to catch it.
For everything there is a season, and a time for every matter under heaven:
Ecclesiastes 3:1 ESV
The author understand that nothing happens in our timing but rather God's timing. God's timing is for everything and we do not know God's timing. This is why our lives are full of smoke we cannot grasp.
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. 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.
Ecclesiastes 2:10-11 ESV
The author realizes that even after accomplishing great things, it did not amount to much. Successful people don't always have as much happiness as other people. Many famous celebrities are miserable. Getting a better job does not mean you will be happier. The happiness is fleeting.
The author tells us life is hard. There is no guarantee that our lives will be successful or richer than others who sin or do not acknowledge God.
But all this I laid to heart, examining it all, how the righteous and the wise and their deeds are in the hand of God. Whether it is love or hate, man does not know; both are before him. It is the same for all, since the same event happens to the righteous and the wicked, to the good and the evil, to the clean and the unclean, to him who sacrifices and him who does not sacrifice. As the good one is, so is the sinner, and he who swears is as he who shuns an oath.
Ecclesiastes 9:1-2 ESV
The author does give us hope.
He has made everything beautiful in its time. Also, he has put eternity into man’s heart, yet so that he cannot find out what God has done from the beginning to the end. I perceived that there is nothing better for them than to be joyful and to do good as long as they live; also that everyone should eat and drink and take pleasure in all his toil—this is God’s gift to man.
Ecclesiastes 3:11-13 ESV
God will fulfill everything He has set out. If our lives are aligned with God's plans, we will do well. Our lives are full of meaninglessness. We cannot understand all of God's ways, and we do not have to. Worrying about things that we cannot control is not smart and will only rob us of joy. Letting God be God and enjoying God's greatness is enough. We can do good and enjoy our lives.
By doing good things, we live in a target rich environment. We can reconcile what needs to be fixed. We can help those who are in need and serve others.
By enjoying life, we can work hard and enjoy the fruits of our labour. We can enjoy the little things in our life. Family, friendship, food, good weather, health are those little things we can enjoy. All we need to do is to open our eyes of heart to experience God's miracle and God's love every single day.
also that everyone should eat and drink and take pleasure in all his toil—this is God’s gift to man.
Ecclesiastes 3:13 ESV