What happens next?

How to clean a memory foam pillow
Remove the pillowcase and wash it as directed.
As soon as you've spilled something, remove the pillowcase and check its care instructions label. Soak it in cool water or wash it according to its care instructions immediately to prevent staining.
Using a liquid-proof pillowcase or pillow protector will help keep your memory foam pillow clean. Since washing it isn't as simple as throwing it in a machine, stain prevention will save you the hassle of more frequent cleanings.