Carpets with a musty odor are both disgusting and harmful. They not only make your house smell bad, but they also have the potential to pollute your air quality with mold and mildew. Carpets and rugs that have been soaked in water will stink. As a consequence, the first step should be to take them outside to dry. They'll dry out quicker if the sun is up, and direct sunlight inhibits mold formation. It prevents any odors from entering your house. If at all necessary, move the damaged carpet outside to dry it out completely. If not, air out your damp carpet by opening windows and using fans.