Cardiopulmonary resuscitation (or CPR) was the Terran term for the manual stimulation of a being's heart and lungs. The technique as used on Earth was first perfected for surgical use in the 1940s, and again for first responders in the 1960s. Layman training in its use was common, and in many cases recommended, by the 1980s, with techniques under constant refinement and revision into the 21st century.
Further advances on Earth at the turn of the 21st century revealed that machines capable of compressing the entire rib cage could circulate blood in a patient far more efficiently than normal Human-administered CPR, which only compresses the sternum. This greatly increased the likelihood of patients surviving cardiac arrest. With the use of cortical stimulators and various advanced medicine, even this was obsolete for routine medicine by the 22nd century. (citation needed • edit)
Though uncommon due to technology, CPR was still used in the 23rd century if so required. Dr. Leonard McCoy attempted CPR on Chancellor Gorkon after technological methods failed. Although McCoy's CPR (along with what was possibly the "precordial thump" technique) revived Gorkon, he died moments later. (Star Trek VI: The Undiscovered Country)
In the 24th century, CPR was used solely in field medicine when other stimulant technologies were unavailable. It was typically used in conjunction with cordrazine, which was included in all field first aid kits. (VOY: "Coda")
CPR proved ineffective for patients who had lost a significant amount of blood. In 2374, Kathryn Janeway attempted CPR on a dying crewmember, but was discouraged by The Doctor for that reason. (VOY: "Scientific Method")