They hear sermons, they pray, they take oaths. And eventually, anyone who isn't an elector is told to leave. The chapel is locked, and the cardinals begin voting. There are multiple ballots each day, and when somebody gets a two-thirds majority, there's a new pope.

How the conclave to elect the new pope works