Before I do anything, I vacuum the carpets, under them too. Make sure you get as much hair, dirt, and debris up. This makes the cleaning process easier.
Next {this is where the magic happens} you are going to pretreat your rugs. I use 1 scoop OxiClean and 1/4 a cup Resolve in 1 gallon of HOT water.
Mix thoroughly in a clean bucket making sure everything is dissolved. Then, using the clean mop, lightly apply the solution to your rug. I use a mop because I’ve wanted to saturate the carpet. You could use a bristle brush if you wanted to really get in there.
Once you’ve lightly applied the solution to the carpet, leave it. Catch up on some laundry, scrub the bathroom grout, do a quick DVR/Netflix binge… pick your poison! Pretreat for about 30 minutes to an hour total.