Clean up as much of the mess as you can using paper towels. Once the spot is dry, sprinkle the area with 1/3 cup of baking soda.
Mix a teaspoon of dish detergent with 1/2 cup of 3% hydrogen peroxide. Wearing a pair of rubber gloves, slowly pour this mixture over the baking soda. Work it into the carpet with a Comfort Grip Scrub Brush.
Once this pasty mixture is dry, vacuum up the residue. If chunks cling to carpet fibers, use the brush to loosen them. Then do a final pass with the vacuum.