Steam Cleaning Carpets vs Shampooing

Is it better to shampoo or steam clean carpets?

How often should I steam clean my carpet? How can I steam clean my carpet at home? Is steam cleaning good for carpets?