Vacuum frequently and thoroughly. Most of the wear of carpeting is caused by dirt. Oily soils attract more oily soil and frequent vacuuming will reduce soil buildup. The longer a stain chemically reacts with the carpet the harder it will be to remove it. Test carpet before shampooing, extracting or spotting.
All carpets are different.
Some carpets are very sensitive to acid type cleaners and will lose their color quickly. Other carpet dyes are sensitive to harsh alkalis. Use appropriate spotters starting with the mildest. Do not use harsh spotting agents unless absolutely necessary and always neutralize high alkaline or high acid cleaners after use. Never dig or brush spots.