Cardiopulmonary resuscitation (CPR) is a life-saving technique used in emergencies when a person's heart stops beating, aiming to restore partial blood flow to the brain and heart. It involves chest compressions and rescue breaths to maintain circulation and oxygenation until advanced care can be provided.