The Catechism in Questions & Answers

646. How is it that sins can be forgiven?

Sins can be forgiven because God—as the God of love—sent His Son to the earth. With His death on the cross, the latter brought the eternally valid sacrifice for the forgiveness of sins. Through the voluntary surrender of His life, Jesus broke the power of Satan and conquered him and his works, namely sin and death. Since then, it has been possible for human beings to be liberated from sin (cf. Matthew 26: 28).
Jesus sacrificed His life for us so that our sins could be forgiven and so that we would not need to remain under the rule of sin.

“Behold! The Lamb of God who takes away the sin of the world!”
John 1: 29
For [...] when we were enemies we were reconciled to God through the death of His Son...”
Romans 5: 10