Close your windows if the weather is still humid outside. If the air inside the house is more humid than the outside air, open as many windows as possible.
Turn on ceiling fans or box fans to help draw moisture out of the carpet. If you have central or window air conditioning, turn it on as well.
Pull as much water out of the carpet as possible with a wet/dry vacuum. Continue until the carpet is dry.
Vacuum the carpet with a regular vacuum cleaner when it is completely dry. This removes dirt and other debris so you can wash the carpet.
Wash the carpet with a carpet cleaner and carpet cleaning solution. Follow the manufacturer's instructions regarding how much cleaning solution to use. You can rent a carpet cleaner at most grocery stores and at some home and garden stores.
Draw out any water left from shampooing the carpet with the wet/dry vacuum.
Vacuum again with the regular vacuum cleaner.
Sprinkle baking soda in a thick layer across the carpet. You can use a broom to work the baking soda deeper into the carpet. Leave the baking soda on the carpet overnight. The baking soda draws out moisture and odor from the carpet.
Vacuum the baking soda out of the carpet. Vacuum a second time in the opposite direction to ensure you remove all of the baking soda. If the carpet still has moisture or a musty smell, repeat the cleaning process.