Cardinals below the age of 80, when the pope dies or resigns, vote in what is known as the papal conclave. To prevent outside influence, the conclave locks itself in the Sistine Chapel and deliberates on potential successors.
While the number of papal electors is typically capped at 120, there are currently 138 eligible voters. Its members cast their votes via secret ballots, a process overseen by nine randomly selected cardinals. A two-thirds majority is traditionally required to elect the new pope, and voting continues until this threshold is met.
After each round, the ballots are burned with chemicals, producing either black or white smoke, signalling to the world about the outcome. Black smoke signals that no decision has been made, while white smoke means a new pope has been elected. Once the pope is elected, a top cardinal announces his name from Saint Peter’s Basilica.

Source….AlJazeera