What happens next?

How to wash memory foam
Soak up as much of the spill as possible with a bath towel.
Press the towel over the wet memory foam and hold until the towel is saturated. Repeat the process until there isn't any more liquid to be soaked up.
A bath towel is best for high absorbency, but you can also use paper towels. If the spill can stain, make sure to use a towel that you don't mind getting stained and dirty.