Timing is Key
In order to properly get rid of coffee stains (as well as many others), timing is essential. You must treat and then launder your stained clothing as quickly as possible for best results.
Dry Up Excess
First things first, get rid of all excess liquid. Using your cloth, blot the effected area to soak up as much liquid as possible. Blotting is applying pressure and lifting it to move to a new spot without moving the cloth over the clothing.
Mix and Apply
Mix the water and laundry detergent together and apply it to the effected area. Ideally, allow the stain or the entire garment to soak in this solution for 15 minutes.
Apply and Rub Alcohol
Apply some rubbing alcohol to a sponge. Remove the garment from the laundry solution and begin by sponging the effected area with the alcohol soaked sponge. This should get rid of the stain.
Once you have treated with the the sponge, put your garment in the washing machine. It is imperative that your garment be washed as soon as possible in order to remove the stain.