How to Clean a Carpet
Before using any cleaning product on your carpet, test it first in an inconspicuous spot on the carpet. Also note that synthetic carpets may require different cleaning solutions so be sure to know the type of carpet you have and check the label of the cleaning product to ensure that you can use it on your type of carpet.
For soda, food and cosmetics first clean the area with a sponge and a small amount of dry-cleaning solution. You want to blot the area to avoid rubbing in the stain. If you have a steam cleaner, use this first being sure not to push the stain in deeper by using the scrubbing pads of the cleaner.
You also want to take care to avoid getting the carpet too wet.
If the stain remains, try use one teaspoon of a mild detergent (no bleach) with a cup of warm water. Blot the area then clean with warm water.
Repeat as necessary.
If dry cleaning solution or mild detergent does not get the job done, try a product specifically designed to clean carpets.
Once the stain has been cleaned, steam clean the entire carpet to remove any residue that is under the carpet. When dry, brush the pile to match the rest of the carpet.
Some stains such as red wine can be very hard to remove. Multiple applications may be required to clean the area.
Unfortunately some stains are permanent and cannot be cleaned. In this case you will need to swap a piece of the carpet from a more inconspicuous area such as a closet. This type of job is best handled by a carpet installer.