How to Remove a Coffee Stain from a Cotton Shirt
To remove a coffee stain from a cotton shirt, start by wetting a paper towel with cold water and using it to blot away as much of the stain as you can. Then, run the shirt under cold water from the back of the stain, so that the water pushes the coffee out of the fabric instead of further in. Next, rub a drop of dish sop onto the stain before rinsing it away with white vinegar to counteract the acidity of the coffee. If the stain is still visible, try applying a laundry stain remover before washing the shirt in cold water and letting it air dry.
Wet some paper towels or a piece of cotton cloth with cold water. Blot the stain with the wet paper towels or cloth to remove as much of the stain as you can. Make sure that you only blot at the stain, as rubbing may cause it to spread. Cold water is best for a fresh stain, since heat can "set" the stain into the fabric. Run the shirt under cold water from the back. Washing from the side opposite the stain will help push the coffee off the shirt, instead of pressing it further in. Wring out the shirt of excess water. Treat with dishwashing liquid. This should pick up some of the stain and mix it into a soapy residue, which is easier to remove. You may use diluted shampoo instead, but only if it contains no fragrance, color, or conditioner. Rinse away the soap with white vinegar. The coffee stain is slightly acidic, so vinegar is more effective than pure water. Repeat the dishwashing liquid and vinegar treatments. You may need to apply dishwashing liquid and vinegar up to seven times to remove stubborn stains. However, if you don't notice any change after two or three treatments, it's probably best to move on to the next step. Use a pretreatment laundry stain remover. If the dishwashing liquid and vinegar didn't do it, move on to a commercial product. Stain removers in bar soap form can be rubbed directly onto the stain, and left for about a minute. Liquid stain removers can be effective as well, but work best when you have time to soak the clothing in water for a longer period of time. If you do not have a commercial laundry stain remover, apply a small amount of liquid detergent to the stain. Rub the detergent onto the stain with your fingers, and let it sit on the shirt for about 15 minutes. You can buy stain removers specifically for coffee, but these are usually expensive for what's hopefully a one-time occurrence. Rinse the shirt thoroughly, then wash. Use cold water for both the rinsing and washing, as hot water can cause a stain to set. Be sure to rinse out the stain remover thoroughly if you use bleach in your laundry, as the two products can react to dye your clothes. Allow the shirt to air dry.  Treat with lemon juice. Test the lemon juice first by swabbing a little on the inside collar. If the fabric doesn't turn yellow, treat the stain with more lemon juice, let sit, and rinse off. Rinse the stain first if the coffee contained a lot of sugar, as this can react with acid to add a new, brownish-yellow stain that's tough to take out. Apply hydrogen peroxide or color safe bleach. You can buy hydrogen peroxide from a pharmacy, or color safe bleach from anywhere that sells household supplies. Test colored fabric first by swabbing a little onto the inside collar. If the color isn't affected, rub over the stain and let sit for a about thirty seconds before rinsing off. If stain persists, apply without rubbing and wait another thirty seconds, then rinse. Repeat as necessary. If the coffee stain has already set, mix the hydrogen peroxide with some dishwashing liquid or liquid soap before applying. Color safe bleach usually includes hydrogen peroxide. If one doesn't work, the other probably won't either. You can use regular bleach instead, for white shirts. Remove the stain using baking soda. Sprinkle some baking soda onto a wet piece of cloth. Use the cloth to blot out the stain. Blot with rubbing alcohol. Apply some rubbing alcohol onto the stain. Blot with a clean, wet cloth. Rinse. Rub with egg yolk. Beat an egg yolk, and add a little warm water. Rub the mixture onto the stain using a sponge or a terry cloth. Rinse. Leave it in the sun. Soak the stain with water and lay the shirt over a towel in direct sunlight. Many stains will disappear after two or three days of hot sun, and it may make the fabric look more vivid as well. 
Wet some paper towels or a piece of cotton cloth with cold water. Run the shirt under cold water from the back. Treat with dishwashing liquid. Rinse away the soap with white vinegar. Repeat the dishwashing liquid and vinegar treatments. Use a pretreatment laundry stain remover. Rinse the shirt thoroughly, then wash. Allow the shirt to air dry. Treat with lemon juice. Apply hydrogen peroxide or color safe bleach. Remove the stain using baking soda. Blot with rubbing alcohol. Rub with egg yolk. Leave it in the sun. 