What wisdom taught him
When Solomon's kingdom began, God spoke to him and asked him a question every one of us could envy. "Ask what I shall give you." This wasn't a genie in a bottle trick where he got three wishes. This was the God of the universe offering to give the king of Israel whatever he longed for. Solomon could have asked for riches and honor (though he was already wealthy, we often want more, don't we?), long life (which of us hasn't at times looked in the mirror and wished there really was a fountain of youth?), death to his enemies (okay, maybe we wouldn't think that far, but in that day, kings had enemies and Solomon had brothers who wanted to see him dead.)
Solomon asked for none of these. He looked out over the expansive kingdom left to him by his father David, thought about how young and inexperienced he was, and asked instead for an understanding and discerning heart.
God gave Solomon what he asked for and those things he didn't ask as well. Solomon was given wisdom and riches and honor, more than any king of his time had ever known.
Solomon recorded much of that wisdom and understanding in the book of Proverbs, advice that still applies to us today. Some of my favorite verses from this book are Proverbs 3:5-6:
Trust in the LORD with all your heart, And lean not on your own understanding;
(Oh, how easy it is to lean on what I know! I look at what I understand instead of trust what God can do, if I will only trust Him with all my heart!)
In all your ways acknowledge Him, And He shall direct your paths.
(This is a daily practice. To acknowledge His presence, to commune with Him. How can I know where I am to go if I don't ask Him?)
The wisdom of God taught Solomon to trust, to lean on God, to love the Lord with all of his heart. And though he strayed from this truth in his later years (despite his wisdom), I believe Ecclesiastes shows us that in the end, wisdom taught him to stop leaning on what he thought he knew and trust the God who had given him that gift of understanding in the first place.