Can You Do CPR?

We've all seen it done in the movies and TV, some one collapses and stops breathing and a passerby or medic performs CPR and miraculously they come back to health coughing and spluttering, but do you know how to do it?