Catechism of the Catholic Church
1673 - When the Church asks publicly and authoritatively in the name of Jesus Christ that a person or object be protected against the power of the Evil One and withdrawn from his dominion, it is called exorcism. Jesus performed exorcisms and from him the Church has received the power and office of exorcizing.178 In a simple form, exorcism is performed at the celebration of Baptism. The solemn exorcism, called "a major exorcism," can be performed only by a priest and with the permission of the bishop. The priest must proceed with prudence, strictly observing the rules established by the Church. Exorcism is directed at the expulsion of demons or to the liberation from demonic possession through the spiritual authority which Jesus entrusted to his Church. Illness, especially psychological illness, is a very different matter; treating this is the concern of medical science. Therefore, before an exorcism is performed, it is important to ascertain that one is dealing with the presence of the Evil One, and not an illness.179
178 Cf. Mk 1:25-26; 3:15; 6:7, 13; 16:17.
179 Cf. CIC, can. 1172.
Punishing Prayer (to be said at moments of temptation - by Fr Chad Ripperger, exorcist )
Lord Jesus, if I am being tempted by an evil spirit, I ask thee to place it at the foot of Thy Cross and force it to contemplate whatever causes it the most pain. For the duration of my temptation and for ten minutes afterwards. I also ask Thee not to allow it to retaliate.