Let us never forget that Ecclesiastes is written from the perspective of Solomon the aged king, whose heart had departed from God.
Yes, he enjoyed the wisdom, but not the righteousness and life of God.
Those are in His right hand, and we have that today because of Jesus!
So, the Preacher writes "The misery of man is great upon him, for he does not now what shall be."
Today, we do know the way, and we know what is ahead for us:
"Thomas saith unto him, Lord, we know not whither thou goest; and how can we know the way? 6Jesus saith unto him, I am the way, the truth, and the life: no man cometh unto the Father, but by me." (John 14: 5-6)
We do not have to fear where we are going, either, because we know that He promises us good things and not evil.
"Blessed be the God and Father of our Lord Jesus Christ, who hath blessed us with all spiritual blessings in heavenly places in Christ:"(Ephesians 1: 3)
"Declaring the end from the beginning, and from ancient times the things that are not yet done, saying, My counsel shall stand, and I will do all my pleasure:" (Isaiah 46: 10)
And His pleasure is ... to prosper us!
"Beloved, I wish above all things that thou mayest prosper and be in health, even as thy soul prospereth." (3 John 2)
We have this promise because of His Son Jesus:
"For this is the covenant that I will make with the house of Israel after those days, saith the Lord; I will put my laws into their mind, and write them in their hearts: and I will be to them a God, and they shall be to me a people:
11And they shall not teach every man his neighbour, and every man his brother, saying, Know the Lord: for all shall know me, from the least to the greatest.
12For I will be merciful to their unrighteousness, and their sins and their iniquities will I remember no more." (Hebrews 8: 10-12)
We know that way--and His Name is Jesus!
We know that good things are coming our way, too:
" But the path of the just is as the shining light, that shineth more and more unto the perfect day." (Proverbs 4: 18)