T.F.
We use ZEP aerosol spray from Home Depot.
I have managed to get rid of doggy vomit stains and red wine stains on our almost white carpet.
You spray it well.. let it sit briefly, soak up all the ZEP with a paper towel.
On a BAD stain, we sprayed it, let it sit, then put paper towels on the stain then put a steam iron on the paper towels and the stain came out. You have to be careful doing this because you can end up with a lighter spot than the rest of the carpet.