Psalms 18:20

The LORD rewarded me according to my righteousness; according to the cleanness of my hands hath he recompensed me.

The Lord repaid the psalmist according to his righteousness and recompensed him according to the cleanness of his hands and conduct. That righteousness consisted in keeping the Lord’s ways and judgments, not wickedly turning away from God, not departing from His statutes, and keeping clear of iniquity. The verse states the general principle that God answers upright conduct with blessing and favor, so that those who in His sight keep their hands from evil and unjust acts may expect His favorable response.