Obviously, foam cushions get dirty like everything else. You can machine wash many fabric covers from your furniture, but not the foam cushion innards. Toss foam cushions in a bathtub to squeeze sudsy, and then clear water through them. The squishing effect draws water in and pushes water out, but it's quickly sucked back in and stubbornly held by foam's soaking power. Putting any soaked object into the dryer isn't safe or practical, and dryers can melt foam -- so that method's out. Therefore, you're going to have to coax the water out with a relatively simple trick, using a different drying process.
Drain the bathtub completely after you rinse your foam cushions.
Push on the foam cushions to squish as much water as possible out and down the drain.
Slide the cushions to the high end of the tub. Lay a couple of towels, one on top of the other, on the exposed bathtub floor. Place a cushion on the layered towels. Fold the towels around the cushion.
Press down on the wrapped cushion to extract water from it, transferring some moisture to the towels. Put the cushion back on the tub's high side. Wring the water from the towels, holding them over the drain. Repeat the wrapping, pressing, and towel wringing processes, until little water leaves the cushion.
Prop the cushion on one edge outdoors in a shady area where it can air dry. Every couple of hours, turn the cushion end over end and back to front to encourage drying from all angles. If you must dry it indoors, place it in front of a fan.
Repeat the water extracting and drying processes with the remaining foam cushions.