Vacuum the area using a wet/dry shop vacuum to remove any water that may still be on the carpet. Take your time when you vacuum to get up as much water as possible.
Blot the area with a clean white towel. A colored towel isn't suitable because the colors from the towel may bleed onto the carpet, which will cause a stain.
Sprinkle powder laundry detergent onto the area. This will act as a scrubbing agent when you clean the area.
Mix a solution of 2 cups water to 1 cup liquid clear laundry detergent in a bucket. Many laundry detergents are blue, which may stain your carpet as you won't be able to fully rinse the detergent out of the carpet. Some laundry detergents made for babies are clear, as are dye-free laundry detergents.
Clean the area with the solution using a clean white towel. Try to use only a small amount of the liquid, because mildew will worsen in damp conditions.
Use the wet/dry shop vacuum to remove any excess water left from the cleaning solution. This will also remove any of the powder laundry detergent.
Spray a light mist of 1 cup water and ¼ cup ammonia onto the area. You should only use a small amount of the mixture.
Open the windows of the car for four hours to let the car air out.