We've been looking at pathways to God's reward and learning that the Lord is invested in paying back those who do a good job. In the case of Ruth, we learned that her decision to choose God led to great rewards. We also learned that being persecuted for choosing Jesus will produce godly rewards.
That said, King David mentions another pathway in 2 Samuel 22:21 - The LORD has dealt with me according to my righteousness; according to the cleanness of my hands he has rewarded me.
These words were said by a man who was far from perfect. He ignored God's laws and conducted a census of his people, despite being warned against it (Exodus 30:11–16; 1 Chronicles 21:1–6). When presented with options for his punishment, he chose a plague to fall on the nation and it led to the deaths of 70,000 (2 Samuel 24). He lusted after and slept with a married woman, whose husband, Uriah, was off fighting in his army. After impregnating her, he crafted a scheme to get the woman to sleep with her husband, so the illicit affair would not be discovered. When that attempt at deception failed, David had Uriah placed at the war front so he'd be killed (2 Samuel 11).

Despite all this, God testified that David was a man after His own heart - a man who pleased Him. That is because David was the sort of man who sincerely repented for offending God and never went back to repeating the sin God forgave him of. David gives further insight on how he managed to be deemed righteous in the sight of the Lord. 2 Samuel 22:22-24 - For I have kept the ways of the LORD; I am not guilty of turning from my God. /All his laws are before me; I have not turned away from his decrees. /I have been blameless before him and have kept myself from sin. And he repeats that his righteous behavior brought forth God's reward in 2 Samuel 22:25 - The LORD has rewarded me according to my righteousness, according to my cleanness in his sight.
It is a wonder that David could manage this given his past. However, the fact that he could is clear evidence that we can do the same and reap similar results. He shows us that we too must aim to live in a way that honors God and His word. David had the Spirit of the Lord resting upon him (1 Samuel 16:13). This caused him to walk in the fear of the Lord. Believers who have submitted to Jesus Christ have received the Holy Spirit, the key to living a righteous life. On our own, we would bow to the deathly desires of our flesh. But with the Holy Spirit, we can rise above our sinful desires. And when we fail, there is the privilege of sincere repentance to receive God's forgiveness. He has promised to forgive and restore those who repent in 1 John 1:9. Plus, God desires to purify us as well as cleanse us from all guilt and shame.
Being conscious of this pathway, we must study God's word more and allow His Holy Spirit to reign in our lives. That way, He will remind us of what pleases God and the strategies needed to achieve that. As we cooperate, we live in a righteous and holy manner that God loves and rewards.
To learn more, please click the hyperlinks above and read the following:
Don't know why I forgot about this boppity bop. Goodness, how times have changed. I remember when I could watch gospel music on BET
No weapon formed against me shall prosper
It'll never prosper
It's by God's grace
All things through Christ Jesus