I had hard wood floors. The prior tenants never let there dog out. I tore out the carpet. And washed that floor with every kind of soap including tsp soap. ( when you strip furniture). Someone said use toilet boil cleaner. Did that twice and the smell was gone. Bought new carpet.
Hi . Sprinkle bicarbonate of soda on your carpets, after 1hr, vacume
For smells in carpet, pour scoopable kitty litter on the soiled areas and let sit to absorb odors. Vacuum, then apply Carpet Fresh for Pets (from dollar store) and do the same. Vacuum.
I use essential oils in a diffuser to help eliminate odors
Carpet usually holds odor because of the pad underneath. I finally ripped all mine out, scrubbed the subfloor and them sealed before installing new floors.