How can I remove cat urine smell from carpet?

We found out our cat has been peeing next to our closet. I’m not sure how long it’s been happening. Today, we used Resolve pet odor eliminator and sprayed it three times. The stain has faded a bit, but the smell is still there. Is there a way to completely remove the smell and the stain from the carpet?

I’ve heard about using a solution of baking soda, vinegar, and peroxide, but I’m not sure how effective it is. Does anyone have any experience with this?