Now all has been heard, here is the conclusion of the matter: Fear God and keep his commandments, for this is the whole duty of man. (Ecc. 12:13)
Solomon, the author of the book of Ecclesiastes, was a king. He had executive, Legislative, and judicial powers all vested in him. He was the richest and wisest man on earth, and his kingdom was at peace. Everyone prospered. He married 700 wives and had 300 concubines (girlfriends). He set his heart to enjoy life, and his conclusion about life is the verse for today. Leading to this conclusion, he described life as vanity; and that the rich and poor die the same way.
So, the best and wisest way to live is to fear God and keep all His commandments. Have a reverential fear of God that will lead us to total submission and worship of God. We will choose to obey God in everything He commands us. So, we must devote time to reading the Bible and living out what God tells us. Do not pursue life as Solomon did. It is a dead-end as he discovered, and as God is warning us.