Place your foam cushions in a well-ventilated area, preferably outdoors on a sunny day. Let them sit in the open air for 24 hours to air out.
Sprinkle generous amounts of baking soda onto the cushions. Baking soda is widely used as a deodorizer and works well on mildew smells. Let the baking soda soak up the odor overnight.
Shake out the bulk of the baking soda. Beat the cushions vigorously to remove any deep-seated baking soda. Use a vacuum cleaner to suck up any excess powder.
Pour vinegar into a spray bottle and lightly spritz the cushions all over. Don't be alarmed if the cushions start to fizz and produce foam; this results from the vinegar reacting with trace amounts of baking soda. Vinegar will not only help deodorize the cushions, but it is also a strong disinfectant and will kill any mildew or mold. Allow the cushions to air dry completely before bringing them back inside. The vinegar smell should dissipate within a couple of hours.