Passage
For all his ordinances were before me, and I did not put away his statutes from me;
For all his ordinances were before me, and I did not put away his statutes from me;
Psalms 18:20 Jehovah hath rewarded me according to my righteousness; according to the cleanness of my hands hath he recompensed me.
Psalms 18:21 For I have kept the ways of Jehovah, and have not wickedly departed from my God.
Psalms 18:22 For all his ordinances were before me, and I did not put away his statutes from me;
Psalms 18:23 And I was upright with him, and kept myself from mine iniquity.
Psalms 18:24 And Jehovah hath recompensed me according to my righteousness, according to the cleanness of my hands in his sight.
The verse centers on "ordinances", "before", "away", and "statutes". It is saying that the verse draws attention to "ordinances" and "before", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 21's "For I have kept the ways of..." into verse 23's "And I was upright with him and...", so "ordinances" and "before" belong inside that flow. In Psalms context, the local focus is worship, trust, the LORD's kingship, and covenant mercy.
A plain takeaway is to answer the verse's own emphasis on "ordinances" and "before" with trust shaped by these words, not by a vague optimism outside the passage.