What is Excommunication?
Excommunication meant you would not be allowed to take Communion anymore. Beginning in the Roman period, bishops or groups of bishops would excommunicate people who were doing things the Church didn't like.
It might not sound so serious, but there were serious consequences. First, if you were excommunicated you could not get your soul clean for God and so you would not go to Heaven after the Last Judgment.
Second, no Christian was allowed to talk to anyone who was excommunicated, or give them food, or rent them an apartment, or in any way have anything to do with them. Even your parents and your children were not supposed to talk to you or let you in their house. When most people were Christians, in the Middle Ages in Europe, this could be life-threatening for ordinary people, and even for kings it was very inconvenient.