What does Psalms 18:20 mean?
The Lord treated me well because I tried to do what was right. He rewarded me because I kept my hands clean. Psalms 18:20 - Modern Text Bible
(David is saying God responded to his honest efforts to live rightly, not because he was perfect, but because he genuinely tried to do what was good.)