For the Life of the Carpet
Everyone likes a nice pair of slippers, leave the shoes at the door.
To best maintain your carpet, it should be professionally cleaned at least once a year. Twice would be better for those high traffic areas. Daily vaccuming, or at least 3-5 times a week, is recommended between professional cleanings.
The best thing to remove a stain is water, as little water as possible. Some over the counter products can lock in the stain making it almost impossible to remove.