Cat urine has a strong, distinct odour because it is made up of ammonia, which is a byproduct of metabolism. The ammonia is ultimately what you smell when your cat has an accident and your cat associates that smell with the area, so it will go back there and urinate again. Neutralise cat urine with an enzymatic cleaner and get rid of the smell permanently.
Soak up fresh urine with paper towels. Do not rub the cat urine stain, this will only spread it around and make more of a mess for you to clean up. You need to get as much of the urine cleaned up before attempting to neutralise it.
Pour an enzymatic cleaning product directly on the urine spot. If you are cleaning carpet, allow the enzymatic cleaner to set for 15 minutes so it has time to penetrate the carpet and get into the fibres. For hardwood floors, place cling film on top of the spot, this allows the cleaning solution to remain concentrated on the affected area.
Dab the area with a paper towel to soak up the solution as well as any urine that remains. If you are trying to neutralise cat urine from an old stain, repeat this process; the longer the urine sits, the more difficult it can be to neutralise.
Enzymatic cleaners eat away at odour causing bacteria and this is how it neutralises cat urine.
Do not use ammonia-based products to get rid of the smell; cat urine is composed of ammonia and this scent is what draws your cat back to the same spot to urinate again.