The best answer depends on your household, budget, and carpet cleaning needs. If your household consists of little ones with sticky fingers, pets, or frequent spills in general, then having a cleaner on hand is super convenient for lots of quick cleaning spurts. Stains can be tackled before they've even had a chance to set.
However, renting a
carpet cleaner is often less expensive than buying since you typically pay per hour, and you can often access commercial-strength machines that would be inconvenient to store and maintain long-term. It could be a good option if you expect to do your deep carpet cleaning only occasionally if don't see a lot of spills or stains in your home, or if you don't have a lot of carpet or rugs.
Professional carpet cleaning is also a great option if you have carpet throughout your home and desire a completely thorough, deep clean. Prices will vary based on your location and the amount of carpet you have, but having a professional handle can alleviate lots of time and stress for homeowners which may justify the costs.