Immediately below the Pope in the hierarchy of the Catholic Church are the cardinals. The primary responsibility of a cardinal is to elect a new pope when a pope dies or abdicates the papacy. However, cardinals don’t just hang out doing nothing until the Pope dies; they have many responsibilities.
Cardinals form the Roman Curia, which is a whole group of administrators (Cardinal Prefects) — something like cabinet members who assist the president or department ministers who assist the prime minister. For example, a Cardinal Secretary of State represents the Vatican to foreign governments. Other cardinals have different areas of responsibility, called congregations. One cardinal oversees all the bishops around the world, another congregation is Catholic education, another deals with evangelization, and so on. The cardinals in the Curia serve as the Pope’s right-hand men, so to speak.
A different cardinal also heads up each of several commissions and councils, as well as three high courts of the Catholic Church: the Apostolic Penitentiary, the Apostolic Signatura, and the Roman Rota, all of which deal with canon law and its application and interpretation.
Cardinals who don’t work in the Curia run an archdiocese, mostly functioning as an archbishop would — ordaining, confirming, and doing the day-to-day business of being chief shepherd of the archdiocese. These cardinals may also supervise two to several dioceses, usually all in the same state or region.
There’s no test to pass to become a cardinal. The Pope chooses bishops he thinks are worthy and elevates them to the level of cardinal.