If thou canst not repress thy lust, thou art obligated to blind thyself.
Or, perhaps, castrate thyself.
Well, not necessarily. Although Jesus did recommend radical self-denial for example, selling all your possessions this particular teaching might not require cutting off your member to avoid illicit sex. Maybe it's a metaphor! Maybe it refers not to one's physical body but to one's community of believers.
The apostle Paul told the believers at Corinth, You are together the body of Christ, and individually you are members of him. (I Corinthians 12:27)
Members who don't obey Church rules should be expelled from Church activities. I'm not a Catholic, but I've always assumed this is what is meant by excommunicating someone: excluding them from the community of believers. Famous Catholics who have been excommunicated in recent centuries include Joan of Arc, Savonarola, Martin Luther, King Henry VIII, Thomas Cranmer, Queen Elizabeth I, Erasmus, Talleyrand, Napoleon, Juan Perón, Josip Broz Tito, the Mafia, and allegedly Fidel Castro.
If you're banished from the Church, that ought to mean you're no longer required to go to Mass (weekly) or to Confession (typically once a month) or to other somber, tedious ceremonies. You can sleep in on Sunday mornings. You are free from religion!
So you're exempt from going to church because you've been banished? Not so fast. Even with a shrunken priesthood, the Church can't afford to lose more members. Further research tells us that excommunicates lose rights, such as the right to the sacraments, but they are still bound to the obligations of the law. Their rights are restored when they are reconciled through the remission of the penalty. They are urged to retain a relationship with the Church, as the goal is to encourage them to repent and return to active participation in its life.
In particular, they are denied Holy Communion but still have to attend Mass. While everyone else goes forward to receive the sacrament, they must sit there in the pew, contrite and alone, serving their penalty.
Recently Cardinal Walter Kasper has advocated that divorced-and-remarried people no longer be barred from the Eucharist. Pope Francis agreed that such people should at least be brought back into the church, but does that mean they can receive Communion? No. As the Pope explained, they're still in a state of mortal sin.
As I said, I'm not a Catholic, so all this seems slightly strange to me. I was brought up as a Methodist.
That denomination celebrates the sacrament only a few times a year. Each time the pastor explains that there are no restrictions.