In case that the pope exempts someone from this section of the canon:
–The Roman Pontiff freely selects men to be promoted as cardinals, who have been ordained at least into the order of the presbyterate and are especially outstanding in doctrine, morals, piety, and prudence in action; those who are not yet bishops must receive episcopal consecration.
Code of Canon Law, c. 351 §1.
can a cardinal who is not a priest (for example, a layman or a deacon) hear confessions, taking this canon into account?:
–In addition to the Roman Pontiff, cardinals have the faculty of hearing the confessions of the Christian faithful everywhere in the world by the law itself. Bishops likewise have this faculty and use it licitly everywhere unless the diocesan bishop has denied it in a particular case.
Code of Canon Law, c. 967 §1.