Cardiopulmonary Resuscitation (CPR) is a practice used when a person's heart ceases to function properly. This is called "cardiac arrest."
It has been a while since my training, and I would not take this as medical advice in any way, but as I recall, the first thing to do is call the person to see if he or she is conscious. If the administrator of CPR believes that cardiac arrest has taken place, time is of the essence. The individual needs to be flat on his back, with head tilted back to make sure the airway is unrestricted. (And someone needs to call 9-1-1 immediately.)
Short breaths are administered alternately, mouth-to-mouth, with nose closed off, along with chest compressions at the appropriate spot. This should be continued until help arrives, at which time paramedics, police, etc., can take over.
It is important for someone to ascertain as best as they can that cardiac arrest is, in fact, taking place, as this procedure should not be practiced on an individual not suffering from cardiac arrest.
One should do his/her best not to panic, and to make sure to have an up-to-date certification.
More specific details can be found in the sources provided.