Clean your carpet with baking soda and vinegar
Simple and inexpensive, this old-fashioned trick works wonders to revive dilapidated carpet pile. First work in the baking soda with a stiff brush (rub it in deeply, working in all directions), then let it sit overnight so that it can fully absorb odours and bacteria.
One may also ask, how do you get bad smells out of carpets?
Once the area is dry, mix 2 cups of warm water with 1 cup of clear vinegar and lightly spray the carpet. The powerful acidity in the vinegar will dislodge the odor-causing compounds and exterminate them for good (or until the next time you leave the window open during a torrential downpour).