26:9-10 David asked God to spare him from a premature death in the company of the wicked. Evidently he expected God to judge the wicked this way and wanted God to separate him from them in His judgment as David had separated himself from them in his behavior. It appears that some people were lumping David together with others who were wicked in their thinking, but he did not want God to do that.
26:11-12 Having called on God to do right the psalmist promised to do the same. He would continue to do right as he waited for God to redeem him from his trouble. "Redeem"(Heb. padah) means to ransom or purchase out of trouble. This word often refers to the Israelites' deliverance from Egypt in the Old Testament (e.g., Deut. 7:8; 2 Sam. 7:23; Mic. 6:4). David felt he was on solid footing in his request and looked forward to praising God publicly for saving him from his accusers.
The people of God can appeal confidently for vindication from the false accusations of spiritual enemies because we have a righteous standing before Him. This is not a claim to being sinless but to being righteous because of God's work for us. The upright behavior of the righteous is evidence that we are, by God's grace, different from the wicked.73