Psalm 26's title says it is By David. It begins with an unusual request: Judge me, Yahweh, for I have walked in my integrity. David is not claiming to be sinless, since he still asks for mercy at the end. He is saying that his life has been sincere and loyal to God, unlike the deceitful people around him. He invites God's inspection: Examine me, Yahweh, and prove me. Try my heart and my mind. For your loving kindness is before my eyes. I have walked in your truth.
His integrity shows up in his choices of company. I have not sat with deceitful men, neither will I go in with hypocrites. I hate the assembly of evildoers, and will not sit with the wicked. He also shows it in worship. To wash his hands in innocence pictures coming to God with a clean life, so that he may make the voice of thanksgiving to be heard and tell of all God's wondrous deeds.
The emotional center is verse 8: Yahweh, I love the habitation of your house, the place where your glory dwells. David longs not just to avoid evil but to be near God. He asks not to share the fate of the wicked, whose right hand is full of bribes. Then he resolves, But as for me, I will walk in my integrity. Redeem me, and be merciful to me. My foot stands in an even place. In the congregations I will bless Yahweh.