First of all, did you know that the church during the middle ages had lots of corruption? Do you want to know how they lost all their power? For example, simony, selling of indulgences, priest and monks breaking their vow of chastity and much more. Last but not least, because Europe entered the age of the renaissance, people became more literate and discovered that the church was not supposed to do these things.
Secondly, the pope and priests were taxing the commoners and using this money to pay for their luxuries lives, even though priests were supposed live the life of Jesus, and Jesus was not a king or a queen or a noble, and was just a peasant. You can undo your sins by praying at a holy