If floodwaters containing, or contaminated with, sewage soaks the carpet you must discard it due to health risks. If the carpet has been immersed in water for more than 24 hours, discard it.
Wear appropriate safety attire when cleaning up after a flood. Wear a N-95 mask, goggles and rubber gloves to protect yourself from potential mold exposure.
Take the carpet outside and hose it down, then use a scrub brush to work a non-phosphate cleaner into the pile. Dry the carpet outside, if possible. If it can't be removed, dry it using a dehumifier and wet/dry vacuum. Circulate air over and under the carpet using a fan. Once dry, spray it down with disinfectant spray.
Carpet padding cannot be salvaged and should be discarded immediately. It is a health hazard to keep it, as it is a haven for mold growth.
Health risks of mold exposure include: allergic reactions, skin irritation, infections, asthma episodes and/or other respiratory problems. People with allergies, asthma and/or other breathing problems are at higher risk due to exposure.