Here is a example of a serious pet problem. This was from a cat that had decided to use this wall as the bathroom. If the carpet is in good condition and worth saving this is the best option. I pulled back the carpet, removed the contaminated pad, and sealed the floor with an oil based primer.
I then put in the new pad.
Made sure tack strip was ready. Cleaned and deodorized the backside of the carpet.
Cleaned and deodorized the top of the carpet. Lots of work but cheaper than replacing the carpet.