Memory foam is a dense, highly absorbent material used in mattresses and furniture cushions. It is known for its consistent durability and support. For memory foam to last a long time, it is necessary to take care of it. Prevention is the key. Use water-resistant covers on furniture that might be exposed to stains. If the memory foam has already been stained--even with human and animal urine--the key is to act fast.
Press paper towels or clean, dry cloth rags over the urine stain to absorb any remaining moisture. Remove them as soon as they are saturated and discard. Continue doing this until you are unable to extract any more moisture.
Saturate the area with white vinegar and blot the area again with clean, dry rags until there's nothing left to absorb.
Sprinkle baking soda over the area that was stained. Leave it overnight and vacuum it up the next day.
Place the mattress outside in a warm, sunny location if you're still concerned about residual moisture.