Passage
I was vpright also towarde him, and haue kept me from my wickednesse.
I was vpright also towarde him, and haue kept me from my wickednesse.
2 Samuel 22:22 For I kept the wayes of the Lord, and did not wickedly against my God.
2 Samuel 22:23 For all his lawes were before me, and his statutes: I did not depart therefrom.
2 Samuel 22:24 I was vpright also towarde him, and haue kept me from my wickednesse.
2 Samuel 22:25 Therefore the Lord did reward me according to my righteousnesse, according to my purenesse before his eyes.
2 Samuel 22:26 With the godly thou wilt shewe thy selfe godly: with the vpright man thou wilt shew thy selfe vpright.
The verse centers on "vpright", "towarde", "haue", "kept", and "wickednesse". It is saying that the verse draws attention to "vpright" and "towarde", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 23's "For all his lawes were before me..." into verse 25's "Therefore the Lord did reward me according...", so "vpright" and "towarde" belong inside that flow. In 2 Samuel context, the local focus is covenant, worship, and faithfulness.
A plain takeaway is to answer the verse's own emphasis on "vpright" and "towarde" with trust shaped by these words, not by a vague optimism outside the passage.