Cardiopulmonary resuscitation, also known as CPR, is performed when the heart stops beating or slows down severely. It involves applying force to the chest to compress the heart.