It depends how bad it is. I used to always recommend Nature's Miracle
. Basically, you need an enzymatic cleaner and any pet store is sure to have some kind of similar product. And it's important to thoroughly clean the carpet or else your cat may continue to pee in the same spot.