Psalm 51:4

4 It is you that I have done bad things against,

only you!

51:4The most important thing is that David did not obey God's laws. He did do bad things that also hurt other people, like Uriah. But David realizes that, more than anything else, it is God that he has turned against.

I have done things that are evil,

as you know.

And so you are fair when you speak against me.

You are right when you say that I am guilty.