If the carpet stain is still wet, try pouring a little club soda on the stained area. Wait a moment and blot until moisture is absorbed.
If you don't find the stain right away, mix a diluted solution of vinegar, soap and water. Dampen a cloth with this solution and press firmly against the stain for several moments. Blot dry with a rinse cloth.
Shaving cream is a great emergency carpet stain remover. Use on ketchup, chocolate, tea, coffee, wine and even blood.
Salt is also a great for absorbing mud stains. Sprinkle it liberally on fresh stains and allow to soak up the moisture. Then vacuum.
Never rub a carpet to soak up liquid that has been spilled. Using as much dry cloth as you need, blot the area until most of the liquid has been absorbed.
If your first treatment fails, let the carpet dry before you try something else. You'll have a better idea how much of the stain remains once the carpet is dry.