David asked God to vindicate his righteousness based upon the past experience of his prayer. He convinced others that he was a godly man whom God set apart for Himself and who called out to Jehovah and whom Jehovah heard when he called out to him. He also admonished others not to sin in anger but to consider in their heart upon their bed and be silent (Psa. 4:1-4). When he was fleeing from his son, he still asked God to vindicate him of his righteousness, but where was his righteousness? David should not have prayed this way. Instead, he should have asked God to enlighten him so that he could see how evil and sinful he was. As a king, he killed one of his fighters by his conspiracy. Then after killing him, he robbed him of his wife. Where was his righteousness?
He also was convincing others that he was a godly man whom God set apart for Himself. He was fleeing, yet he considered that he was set apart by God. This shows that he was in darkness. In considering Psalm 4, we need to remember that this was a psalm written by David at the time when he was fleeing. At that time, he indicated that he was a godly man whom God had set apart for Himself. Was that the time for him to pray in this way?
This shows that we human beings always are not easily convinced of or subdued in our sinfulness. Even if we murdered someone and committed fornication by robbing, we would not be convinced. We still would think we are good. We might vindicate ourselves by saying, "Yes, maybe I was wrong in certain matters, but I am a godly person whom God has set apart for Himself." I have been touching people for sixty years in the Lord's recovery, but I have nearly never had a time with one who was thoroughly convinced by God of his failures. In the law court, neither the plaintiff nor the defendant think that they are wrong. They cannot be convinced that they are wrong. We all need God's mercy to see our failures, our sinfulness, and our filthiness, to even roll on the floor in confession of our sins. This means that we have received mercy and found grace in the presence of God. As long as we would not be convinced of our sinfulness, we are wrong and in darkness.
In Psalm 4 David even admonished others not to sin in anger but to consider in their heart upon their bed and be silent. This is a good teaching, but why did David not teach himself? Was he the right person to pray this way? If you know his background, you can see that he was not the right person.