When Solomon wrote this there had only been two previous kings of Israel. He had heard about the path of Saul. David had been his father. Saul had sinned and not genuinely repented. He was removed by God. David also sinned but his repentance was genuine. One is regarded as a failure, the other a success. God chose them both but viewed them differently.
(1 Samuel 13:14 KJV) But now thy kingdom shall not continue: the LORD hath sought him a man after his own heart, and the LORD hath commanded him to be captain over his people, because thou hast not kept that which the LORD commanded thee.When you move water around, sometimes you let it flow naturally, sometimes you build damns. Sometimes gravity pulls it, other times you need a pump. God has methods and influence we cannot dream of. The key is that He will see His will done, if not by us, then by someone else.
So? You may not be a king but you can bring a willing heart. Remember that David started out as a younger son and a shepherd. He ordered murder and committed adultery. God still found a way to see into his heart.