The homemade cleaning solutions we recommended above are best for removing dirt and grime. Odors are another matter. Pet odors respond better to white vinegar or isopropyl alcohol. You definitely want to dilute them, so you don’t damage the carpet fibers. Mix equal parts of vinegar or isopropyl alcohol and water, then spray it on the carpet. Rinse the carpet, and use a clean towel to soak up the cleaning solution. Be sure to test the solution in a small area before starting. You can also sprinkle baking soda onto the carpet and let it soak up odors for several hours. When you vacuum up the baking soda, the odors come with it.