David's life is a cautionary tale and at the same time a model for us to follow. David sins and then records his confession. Psalm 51 is his confession of sin and it shows us much about how to approach God and how to confess in a way the God hears and forgives.