Passage
For all his Lawes were before mee, and I did not cast away his commandements from mee.
For all his Lawes were before mee, and I did not cast away his commandements from mee.
Psalms 18:20 The Lord rewarded me according to my righteousnes: according to the purenes of mine hands he recompensed me:
Psalms 18:21 Because I kept the wayes of the Lord, and did not wickedly against my God.
Psalms 18:22 For all his Lawes were before mee, and I did not cast away his commandements from mee.
Psalms 18:23 I was vpright also with him, and haue kept me from my wickednes.
Psalms 18:24 Therefore the Lord rewarded me according to my righteousnesse, and according to the purenes of mine hands in his sight.
The verse centers on "lawes", "before", "cast", "away", and "commandements". It is saying that the verse draws attention to "lawes" and "before", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 21's "Because I kept the wayes of the..." into verse 23's "I was vpright also with him and...", so "lawes" 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 "lawes" and "before" with trust shaped by these words, not by a vague optimism outside the passage.