Make sure to vacuum your carpet regularly; this will help dirt from building up in the fibers and damaging the carpet itself.
If you spill anything on your carpet make sure to clean it up right away. They longer a liquid sits on your carpet the deeper it will go into the fibers making it harder to get back out. Most stains you can lift with water but others, like red wine stains, can be more difficult.
Use rugs or carpet runners in high traffic areas. Constant traffic can cause the carpet to flatten, sink, and eventually wear out making it look dull and worn with no way to bring it back to its original coloring and volume.
Make sure to get your carpet deep cleaned on a regular basis. Not only will this leave your carpet looking bright and beautiful but will also remove deeply embedded dirt.
Place a shoe mat at the front door; this will help remove some of the dirt that will be tracked in to your home and carpet.