The Catchism of the Catholic Church explains that there are two effects of sin: eternal punishment and temporal punishment, and also what is required for penance.
The punishments of sin
1472 To understand this doctrine and practice of the Church, it is necessary to understand that sin has a double consequence. Grave sin deprives us of communion with God and therefore makes us incapable of eternal life, the privation of which is called the “eternal punishment” of sin. On the other hand every sin, even venial, entails an unhealthy attachment to creatures, which must be purified either here on earth, or after death in the state called Purgatory. This purification frees one from what is called the “temporal punishment” of sin. These two punishments must not be conceived of as a kind of vengeance inflicted by God from without, but as following from the very nature of sin. A conversion which proceeds from a fervent charity can attain the complete purification of the sinner in such a way that no punishment would remain .84
1473 The forgiveness of sin and restoration of communion with God entail the remission of the eternal punishment of sin, but temporal punishment of sin remains. While patiently bearing sufferings and trials of all kinds and, when the day comes, serenely facing death, the Christian must strive to accept this temporal punishment of sin as a grace. He should strive by works of mercy and charity, as well as by prayer and the various practices of penance, to put off completely the “old man” and to put on the “new man.” 85
84 Cf. Council of Trent (1551): DS 1712-1713; (1563): 1820.
85 Eph 4:22, 24.
1450 “Penance requires . . . the sinner to endure all things willingly, be contrite of heart, confess with the lips, and practice complete humility and fruitful satisfaction.” 49
49 Roman Catechism II,V,21; cf. Council of Trent (1551): DS 1673.
CCEO (canon law)
Canon 718
In the sacrament of penance, the Christian faithful who committed sins after baptism, internally led by the Holy Spirit, turn back to God, moved by the pain of sin, intent on entering a new life through the ministry of the priest, having themselves made a confession and accepted an appropriate penance, obtain forgiveness from God and at the same time are reconciled with the Church which they injured by sinning; by this sacrament they are brought to a greater fostering of the Christian life and are thus disposed for receiving the Divine Eucharist.