If you are lucky enough to catch the animal in the act, you can pour salt liberally onto the deposit while it is still wet. Use enough salt to completely cover the spot. The salt will absorb the urine. Let it dry and simply vacuum it away.
But most animals are secretive about peeing on the carpet; most of the time it is dry by the time you discover it. Single, light urine deposits may be treated by applying a neutral carpet cleaning agent, gentle agitation and a thorough rinse. Finish the job by placing a folded white towel on the area. Set a weight on it and leave overnight; the remaining moisture and residue will wick into the towel.