Cardiopulmonary resuscitation
They can use a machine called a defibrillator to give an electric shock to the heart.  This will not restart a heart that is not beating.  However, if the heart is beating in a way that is not normal, the electric shock may make the heart go back into a normal rhythm.