Through Jesus Christ's saving sacrifice and the ministry of the Church through the priest, the eternal punishment, namely hell, that our sins merit, is done away with in the Sacrament of Penance. However, the temporal punishment is not. So, we do penance in this life, offer up our pains and suffering, as well as engage in penitential practices (i.e., willingly deprive ourselves of good things, like meat on Fridays- to pick just one example) in order detach ourselves from things and thus strengthen ourselves for when temptation comes knocking and to lessen the intensity of our purgatorial experience or avoid Purgatory altogether. It is not our aim "to avoid Purgatory," but to be with God in heaven. Penitential acts are how we make satisfaction for our sins, without which we cannot attain heaven.
Purgatory is a dogma of the Catholic faith. It is not something that can be wished away. We ignore this fundamental truth at our own peril. It is through acts of penance that the "egoism," which is probably our biggest obstacle to sanctification, invoked by then-Cardinal Ratzinger, is confronted, challenged, and, by our cooperation with God's grace, given us especially through the sacraments, eventually overcome by living the circumstances of our lives united to Christ.
The Second Vatican Ecumenical Council, invoking the Second Council of Nicea, the Council of Florence, and the Council of Trent in the Dogmatic Constitution on the Church, Lumen Gentium, decreed: "This Sacred Council accepts with great devotion this venerable faith of our ancestors regarding this vital fellowship with our brethren who are in heavenly glory or who having died are still being purified; and it proposes again the decrees of the Second Council of Nicea, the Council of Florence and the Council of Trent. And at the same time, in conformity with our own pastoral interests, we urge all concerned, if any abuses, excesses or defects have crept in here or there, to do what is in their power to remove or correct them, and to restore all things to a fuller praise of Christ and of God" (par. 51).
To cite just one of the three references made by the fathers of the Second Vatican Council, from the Council of Florence: "If they have died repentant for their sins and having love of God, but have not made satisfaction for things they have done or omitted by fruits worthy of penance, then their souls, after death, are cleansed by the punishment of Purgatory."
In the second section of her "Treatise on Purgatory," St. Catherine of Genoa wrote:
There is no peace to be compared with that of the souls in purgatory, save that of the saints in paradise, and this peace is ever augmented by the inflowing of God into these souls, which increases in proportion as the impediments to it are removed. The rust of sin is the impediment, and this the fire continually consumes, so that the soul in this state is continually opening itself to admit the divine communication.The point is that we are to cooperate with God's work in this life so as to remove the "rust of sin" as much as possible so that we, to use St. Paul's words to the Philippians, "shine like lights in the world" (Phil 2:15), living lives ordered towards our supernatural end.
As a covered surface can never reflect the sun, not through any defect in that orb, but simply from the resistance offered by the covering, so, if the covering be gradually removed, the surface will by little and little be opened to the sun and will more and more reflect his light. So it is with the rust of sin, which is the covering of the soul
I would also refer you, dear reader, to sections 45-48 of Pope Benedict XVI's second encyclical letter, Spe salvi for more on Purgatory. In these sections Pope Benedict sought to give an understanding of Purgatory in light of more recent theology.