hatever David was guilty of at the time of the composition of this Psalm, we find in this passage that he was both humble and contrite. So, he cried out for mercy and deliverance. He asked for mercy on the grounds of God's character and compassion (Psalm 6:4 & 9).
When we ask for mercy, we are always asking for something that is undeserved. So, we certainly can't demand it based upon our own merit. What we can do is claim the promises of God and appeal to the genuine love which we know that He has for us. Don't get me wrong, I am in no way willing to imply that we can or should try to manipulate God. God can't be manipulated. That would be an absurd impossibility. But, the mercy which we do receive is always based upon God's traits, not upon ours.
Still, David's heart was broken by whatever his situation was. Weariness, tears, insomnia and depression had a grip on him. Yet, in the middle of his difficulty, he was still confident that help was on the way, because God had heard his prayers. How did he know that? By faith! And, why did he have faith? Because, his eyes were not upon his own goodness. His eyes were focused on the greatness of God.