Here there is guilt (verse 4) as well as sickness (verse 5). The illness is linked to the psalmist’s sin in some way, either as the physical effects of a tortured conscience or as the result of some foolish behavior or as a messenger sent to humble the psalmist and bring him to his senses about the way he is living. This illness in turn has isolated him from friends and given his opponents an opportunity to move against him (see verses 11–12). So he is suffering from guilt, bodily pain, and injustice. Suffering often comes in such overwhelmingly complex compounds that the only solution is to simply call out to God himself to forgive, protect, and heal.
David does not merely admit his sin but is troubled by it (verse 18). If we only confess but do not also find the sin repellent—for how it grieves and dishonors God and destroys others—the sin will retain its power over us. We will find ourselves doing it again. Also, he seeks not just legal pardon but the restoration of loving fellowship with God (verses 21–22). This is possible because this God is “my God”—the God of covenant grace who is committed to him (Exodus 6:6–7). The depths of that commitment were seen fully only in the one who cried, “My God, my God” and was forsaken so we could be pardoned and brought in.