When someones heart stops their brain begins starving for oxygen since no blood is flowing to the brain.
Within 20 to 30 minutes of the heart stopping the brain can start to die off so it's important to start CPR or other heart restarting procedures and get medical help right away.
If someones heart stops call 911 first and then begin CPR while on the phone with 911 and the 911 operator will give you instructions on how to perform CPR.