Psalm 51 is a prayer of repentance, written by King David after his sin with Bathsheba and the murder of her husband, Uriah. David confesses his sin, acknowledges his guilt, and asks for God’s mercy and cleansing. He expresses remorse, seeks a renewed spirit, and desires to experience joy and fellowship with God again. The psalm emphasizes God’s desire for a broken and contrite heart over sacrifices and burnt offerings.