If your dog or cat looses its lunch on the carpet leaving a red stain, it is the red dye from their food. Switch to a neutral color food to end this problem. Dogs and cats are colorblind. They can't see the red in their food.
Red dye is also found in punch, Popsicles, Kool-Aid and candles that are red or purple in color. Prevent these stains by switching to a light color or one that does not have red, orange, purple or other dark colors. Do your health a favor and the health of your family and don't eat or drink things that contain artifically colors. Rather freeze fruit like ripe bananas and grapes for snacks instead of sugar laden Kool-Aid and Popsicles.
Pour peroxide from a fresh bottle of peroxide on the stain. Wait 30 minutes, rinse with vinegar and water then plain water. Repeat if needed. Peroxide might take the color out of some fabrics. Test for color fastness first.