Our daughter wet our bed so we had a smelly urine stain on our memory foam mattress. Here is what I did to remove the smell and stain.
Buy some 29% hydrogen peroxide. Not the mild 3% solution you get at Walmart or local Pharmacy. Follow the link below to shop for some.
The 29% H202 is corrosive and will burn your hands at full strength so use caution and wear gloves. Take about 2 cups of water and 20ml of peroxide (about a full shot glass) and mix it together. Apply the whole amount to the stain and let it sit for a minute or two then soak it up with a towel. You should hear fizz and generate some heat as the H202 reacts with the stain and towel.
Get a small fan and blow it across the wet spot on the bed to speed up the drying process.
As they say your mileage may vary. You can experiment with the dosage however be very careful as 29% H202 is a corrosive at full strength and will make your skin a minute or two after exposure.