Old Testament readings use the Septuagint , the Scripture the apostles quoted. Masoretic numbering shown for reference.Learn why
KJV

Psalms 18:21

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

Read in other translations