Psalms 18:22

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

21 For I have kept the ways of the LORD, and have not wickedly departed from my God.

For all his judgments were before me, and I did not put away his statutes from me.

23 I was also upright before him, and I kept myself from mine iniquity.

24 Therefore hath the LORD recompensed me according to my righteousness, according to the cleanness of my hands in his eyesight.

Do read the surrounding verses too, because the context often says more than a single verse.

Compare

BSB
For all His ordinances are before me; I have not disregarded His statutes.
KJV
For all his judgments were before me, and I did not put away his statutes from me.
WEB
For all his ordinances were before me. I didn’t put away his statutes from me.
ASV
For all his ordinances were before me, And I put not away his statutes from me.
DARBY
For all his ordinances were before me, and I did not put away his statutes from me;
BLB
For all His ordinances [are] before me, and I did not turn aside His statutes from me.
ÅB
For alle hans lover hadde jeg for øye,
og jeg lot ikke hans bud vike fra meg.
OTB
For alle hans dommer var for meg,
Og jeg har ikke oversett hans forskrifter.
B1930
For alle hans lover hadde jeg for øie, og hans bud lot jeg ikke vike fra mig.

Study notes (Tyndale)

Original text and word study

Cross references