The Lord and His judgment
David cried out to God,
“So the congregation of the peoples shall surround You; for their sakes, therefore, return on high. The LORD shall judge the peoples; judge me, O LORD, according to my righteousness, and according to my integrity within me” (Psalm 7:7-8).
In verse 6, David revealed a problem of having enemies, and thus he makes the plea found in verses 7 and 8.
We want God to judge our enemies, but knowing that we shall also be judged, we should ask God to judge us according to our righteousness, which means we should have or be righteous, otherwise, the prayer is meaningless.