Excommunication was a Christian idea. It meant you could not take Communion anymore. Beginning in the Roman period, bishops or groups of bishops excommunicated people who were doing things the Church didn’t like. The Pope sometimes personally excommunicated very powerful people like kings and emperors. It might not sound so serious to be excommunicated. Who cares, right? But there were serious consequences. First, if you were excommunicated you could not get your soul clean for God. So you would not go to Heaven after the Last Judgment.
Second, you’d have a lot of problems right here on Earth. Christian bishops said that if someone was excommunicated, no Christian could talk to them, or give them food. Nobody could rent you an apartment, or in any way have anything to do with you. Even your parents and your wife and your children were not supposed to talk to you or let you in their house. In places where most people were Christians, as in the Middle Ages in Europe, this could be life-threatening for ordinary people. All of a sudden you might be homeless and poor. And even for kings it was very inconvenient.
In the Middle Ages, the Popes excommunicated a bunch of very powerful men. Some famous examples are the Roman Emperor Theodosius, King Henry II of England, Emperor Henry IV of Germany, and King John of England.