If you want to keep your carpets as clean as possible, it isn't enough to vacuum them regularly. Dirt, dust and other unpleasant debris can penetrate down where vacuums cannot reach, so steam cleaning once or twice a year is necessary to really keep your carpets in prime condition. Essentially, steaming cleaning uses water moisture heated to a high temperature. That hot water removes stains and debris from the carpet, and is then sucked up itself.
There are plenty of online resources detailing how to handle steam cleaning yourself, and you should be able to rent a steam cleaner. Be that as it may, you should still strongly consider using a carpet cleaning professional instead. Why? Because they understand the process and are able to use top of the line equipment.
The principles behind steam cleaning are pretty easy to grasp, but carrying out steam cleaning isn't quite so straightforward. To start with, you need to understand exactly what type of machine to use and how much water to apply. If you don't use enough water, steaming cleaning will not be effective. If you use too much, your carpets will take an unnecessarily long time to dry. You may also use a setting too hot or too cold for your particular type of carpet, which could ruin it altogether.
Maybe you could acquire the relevant knowledge online, but why not hire a professional instead? They'll know exactly how much water to use, what setting to go for, and what type of machine is best for your carpet.
Perhaps more important than the skill and experience of the operator is the quality of the machine. One of the main issues with DIY machines is that they cannot heat water to the same high temperatures as the machine a professional is likely to use. As such, cleaning is generally far less effective since it's the heat that removes stains and embedded dirt.
DIY machines also lack the power of commercial ones, meaning that they may not be able to extract as much water. Without extracting a decent amount of water, you won't be extracting a decent amount of dirt, and your carpets are going to take longer to dry.
A professional will naturally use commercial-grade steam cleaners. They'll even be able to switch between more powerful units for heavily-stained areas and smaller but more portable ones to reach into every nook and cranny.