If a Catholic gets excommunicated, how can he get out of it?
The most important aspect for one who commits a serious sin, which is also an ecclesiastical crime with a penalty attached, is to be repentant, truly contrite, and resolved not to commit the sin and crime again. Then such a person should go to confession. The priest who hears the confession will give the person appropriate advice and assistance. If the absolution from the censure (excommunication) is reserved to the bishop or the pope, the priest will make the arrangements. Many times, however, the priest himself is permitted to directly and immediately absolve from both the excommunication and sin.
Reprinted from November 1, 1996