If David is innocent, he asks for God's protection. He also asks God to declare him as righteous.O Lord my God, if I have done wrongor am guilty of injustice,if I have betrayed a friendor plundered my enemy without cause,then let my enemies capture me.Let them trample me into the groundand drag my honor in the dust. Psalm 7:3-5 (NLT)
We, too, have the ability to plead our case before the Lord and ask for His justice to prevail. But, we also need to understand that if we have wronged those around us, we must be prepared to be judged as well. Part of that judgement is making restitution to those we have wronged. Yes, it is something very difficult to do, but it must be done. It is the act of a righteous individual who understands God's laws.
God defends the righteous and judges by looking deeply into their minds and hearts. By doing so, God is an honest judge. Once again, God is our judge and He is just and will seek the truth.
Then let the heavens proclaim his justice,for God himself will be the judge. Psalm 50:6 (NLT)