Remove all furniture from the room(s) with the moldy carpet. If the furniture itself shows signs of mold contamination (moist discoloration accompanied by a sour odor), place it outside in direct sunlight to dry. Then wipe it down with a sponge, using a mildew-fighting product such as 5-percent vinegar or diluted chlorine bleach (one part bleach, one part water).
Dry your carpet. A wet dry vacuum (set to its "dry" setting) works best, and you can rent this type of vacuum from many hardware and home-improvement stores. If you still cannot get your hands on a wet dry vacuum, use a dehumidifier or air conditioner until the entire carpet feels thoroughly dry.
Spread baking soda over your carpet. Leave it for approximately one to two hours, during which time you should not walk on the carpet. Allow the baking soda to penetrate your carpet and absorb the dried mold spores.
Vacuum your carpet to remove the baking soda, and thereby remove the difficult spores that contribute to mold contamination and odor. Roll the vacuum over each section of carpet several times to thoroughly access every inch.
Shampoo your carpet to clean more thoroughly and deodorize. Rent a carpet shampooer from your local grocery store or home-improvement store and mix carpet shampoo with hot water as indicated on the carpet-shampoo bottle. Run the carpet shampooer over the entire carpet. Then use a dehumidifier or air conditioner to dry the carpet.