Excommunication is a punishment that is handed out by the Church when one of its members who breaks some really important rule is cut off from the Church. Now, we must understand that it is a punishment that is applied when a person must have broken a great rule of the Church; some of which are contained in the 1983 Code of Canon Law, sins like apostasy, heresy, schism, violating the sacred, physically attacking the Pope and so on. But it is revocable and whoever is the offender can be welcomed back into the fold given that he is repentant.
This, however, does not mean that excommunicants will end up in Hell. God alone has the power to decide who ends up either in Heaven or in Hell because He alone knows all, not the Church. The Church’s responsibility is to help bring everyone to God’s fold in any means possible, not condemn them. Excommunication merely serves as a warning to the offender that his actions could lead him to damnation unless he repents. It does not mean the person ceases to be a Christian.
The use of excommunication is really employed in these modern times in order to avoid losing its effectiveness and end up not achieving its main purpose which is to help reconcile the people to God. And just like Saint Paul in Galatians 1:8 said that whoever preaches a contrary gospel should be cursed; He never condemned the offenders to Hell but simply emphasized that their teachings were false. The same applies to the Church. When the Church authorities excommunicates one of its members on grounds of a serious offense, it does not condemn the person to Hell but simply uses it as a means to indicate that the person’s actions are against the will of God made manifest through His Church.Disclaimer: Prayer is not magic. God indeed answers prayers but sometimes His answer is either No or Not Now. Don't be discouraged when your prayers are not met immediately or even later. Keep trusting God who is good all the time. Thank you.