Summarize this article:

Use a soft brush extension and a low power setting when running the vacuum over memory foam. Clean as much extra debris as possible to keep it from getting ground into the mattress when you clean. In a spray bottle, combine 4 fluid ounces (120 mL) of laundry detergent and 8 fluid ounces (240 mL) of cool water. Shake well and make sure that the two ingredients are fully mixed before spraying. Spray the stain and gently soak up the liquid with a towel. Keep repeating this until the stain disappears. Since you may not be able to completely remove all of the detergent, make sure to use a gentler, unscented formula. Look for detergents labeled “hypoallergenic.” Mix together 1 part baking soda and 2 parts water until it forms a milky white liquid. Work the solution into the stain using circular hand movements and leave it to soak for half an hour. Use a slightly damp cloth to remove the solution. Soak up any remaining liquid with a bath towel. Set the memory foam product in a bright, open space to dry before using it. Make sure it is completely dry to reduce the risk of mold and mildew. Direct sunlight will help dry the foam more quickly and dispel odors. Some stains may need several rounds of washing to fully disappear. Let the mattress fully dry after each time you use the detergent solution followed by the baking soda paste.

Summary:
Vacuum first to remove dust, hair, and lint. Spray the stained area with a laundry detergent and water solution, then blot. Soak stubborn stains with a baking soda solution. Let the memory foam dry completely. Repeat the process if the stain is stubborn.