Disobeying God damages our friendship with him so we need his forgiveness to heal it. That’s why Jesus initiated the Sacrament of Reconciliation (also called "Confession"). "Whatever you bind on earth shall be bound in heaven, and whatever you loose on earth shall be loosed in heaven" (Matthew 16:19). This brings us back to God.
In Confession we admit what we did, say that we’re sorry, and resolve never to do it again. Penance helps us make up for it. When the priest conveys Christ’s forgiveness to us, our friendship is restored.