Use foaming carpet cleaners. These types of cleaners can be produced in aerosol, liquid or powder form. Read the instructions on the package and follow them. Use a vacuum cleaner to remove dirt. Apply the foaming cleaner following the manufacturer's directions, then wipe off in a circular motion. Don't add water. These cleaners are most effective when applied to dry carpet.