The person who prays makes an appeal to the Lord as righteous Judge. His pronouncement may end up being positive and negative. Through the Lord’s justice, the sinner is punished and the just is acquitted.
That is why he asks the Lord to bring justice, because of his innocence. Over against his enemy, he is convinced that he is righteous. He counts himself among the righteous ones. His heart is open before the Lord, and God does justice. God knows everyone’s heart (see Jeremiah 11:20a, But, O Lord of hosts, who judges righteously, who tests the heart and the mind…
and Jeremiah 17:10, I the Lord search the heart and test the mind
and the same in Jeremiah 20:12a). So, he punishes evil. That is what the poet prays—that God may bring disaster upon them (Jeremiah 11:11).
We should not think of an atheist, but perhaps of a fellow countryman who behaves in a godless manner, and is therefore guilty (Hebrew “rasjaa”, also see Psalm 36:1). And for this, there are easily more than twenty indications that one can find, such as offenders, foolish men, hypocrites, cheaters, men of blood and so on. Also, foolishness (Hebrew “nabal”) is an indicator for people who do not want to include the Lord in their life planning (See Psalm 14:1, Isaiah 32:6).
The one who prays calls himself just. That is no arrogance, but it is to notice God’s work of grace working in you. You have a desire to live very close to God (see Ezekiel 18:5–9). You may describe it as living with God in the covenant.
More people are attested to be righteous. Zechariah and Elizabeth (Luke 1:6) and John (Mark 6:20). We can also think of those who are called blessed
by Jesus in Matthew 5:3–12. They are blessed because they are walking with God.
That does not mean that a righteous person is without sin (Psalm 143:2). We all need the redeeming death of Jesus. What matters is to distinguish between righteous people—those who want to serve God, live from grace and redemption over against unbelievers, and those who reject the gospel of God, ward off the Spirit, and show enmity against the servants of God. To live in sin is, so to say, their element. Psalm 1:1–6 gives clear teaching on this point: Blessed is the man who walks not in the counsel of the wicked.
See also Psalm 104:35 Let sinners be consumed from the earth, and let the wicked be no more!
Also consider James 2:24 You see that a person is justified by works and not by faith alone.
In the meantime, faith is always a dynamic happening. You cannot say once a sinner, always a sinner.
The Bible is full of calls to repent.
9 Oh, let the evil of the wicked come to an end, and may you establish the righteous you who test the minds and hearts, O righteous God!