If you know where the Urine spots are you can easily do this, if you need help in finding where the urine spots are even old ones that have dried you can simply use a black light to find them. Use the shine the black light closely to the carpet and all the spots should show up glowing.
Once you've found the areas to be treated you'll need to sprinkle Baking Soda on all the stains and rake into the carpet getting it down to the bottom of the carpet and into the padding. If your carpet really smells let it sit for a day or two, otherwise let it sit for 2 hours. The baking soda breaks down the enzymes in the urine and binds it to help relieve the carpet from smells.
Once the baking soda has been on the carpet, simply vacuum it up. If the smell still persists, repeat the steps again. If the smell still persists, the problem could be deep into the padding and the underlying slab. You may have to call a professional to deep clean it as well as pull up the carpet and padding and treat the underlying slab or wood floor.