Carpet pet urine odors are likely to occur even with a well-trained pet. Sooner or later, an accident happens, and quick action on your part will make the difference in whether or not the odor is locked in forever, or removed.
Baking soda can be mixed with cool water and used to blot the wet spot and odor away. A tablespoon to about a quart of water is best. If the carpet is dry and has an all-over urine smell, try sprinkling dry baking soda on the carpet, allow it to sit 15 minutes, then vacuum completely. This should help to neutralize the odor.