Sprinkle dry soap over the carpet mold and wipe the spots with a damp cloth.
Steam the floor using a steam cleaner. Steam cleaners work similarly to vacuums. They steam the floor and add shampoo to the carpet. When pulled back over the spot, they suck the shampoo up along with grime and water and store it into another container in the steam cleaner.
Remove the carpet from the subflooring and let it dry outside.
Throw away the padding beneath the carpet. The padding will contain mold and mildew that is impossible to remove. Removing the padding will remove the odor and the chances of having mold return.
Allow the subflooring to dry. You can dry the floor using a dry mop pad if desired.
Place a new padding on the floor using a knife to cut it to the dimensions of your home and place the carpet back over it.