The Roman Catholic practice of confession entails the confession itself, the granting of absolution and prescription of penance. Venial sins may be confessed privately to God but mortal sins must be confessed to a priest.
Some of the texts used to uphold this practice are:
Matthew 16:19, Jesus told Peter, “whatever you bind on Earth will be bound in heaven, and whatever you loose on Earth will be loosed in heaven.”
John 20:23 “If you forgive the sins of any, they are forgiven them; if you retain the sins of any, they are retained.”