Blot up fresh accidents with paper towels as soon as you discover them. Don't rub the spot; this will push it further into the carpet fiber. Cleaning the stain will not necessarily remove the odor, so you must neutralize the stain and deodorize it as well.
Rinse the spot with cool water, even if it's dried. Liquid stains seep down and spread out, into the padding, so treat the area several inches around the spot. Blot again with fresh paper towels.
Sprinkle the area with baking soda. If pets or family members must walk on it, cover it with a clean cloth. Let it sit overnight, then vacuum up the baking soda.
Mix 2 cups white vinegar with 1 gallon water, and wash the carpet spot with the solution. Rinse well, and blot with paper towels. Cover the carpet with a clean cloth, and let it dry. The vinegar smell will dissipate and remove the odor.
Fill a spray bottle with the vinegar and water mixture, and spray the area again, if needed.
Wet the carpet with cool water, and sprinkle baking soda or salt over the area. Let it set until dry, then vacuum. Sprinkle again with baking soda and vacuum.
Soak the carpet with club soda. Blot and let dry.
Wash the spot with baking soda mixed with water, if the odor is still present. Blot with paper towels.