Dirt or something else? Pretreat with a good product like Resolve and steam clean it. Just from experience, I can tell you that if you have been sprinkling the carpet with a powder to freshen it, which I used to, you will find you need to vaccum really well and you may need it cleaned more than once. My daughter couldn't get hers clean so she hired Stanley Steamer to come in and clean. I couldn't believe how great it looked!
Hi Barbara Ann, test this in a spot like under a chair or in a closet
Mix 1/4 cup salt, 1/4 cup borax and 1/4 cup vinegar, then apply this paste to deep stains or heavily soiled sections of carpet. Allow the paste to sit on the carpet for several hours until it dries completely, then vacuum it away.
You would best hire a professional company.
Use a laundry pretreater or carpet stain remover and spray the carpet. Let it sit overnight if possible. Then scrub it with a Rug Doctor. I add Oxyclean to the tank sometimes. Then scrub again with just hot water and repeat.