Have you ever washed something made from foam and then tried to look up on the internet how to dry it, only to find that you weren't supposed to get it soaked in the first place? Well, I just did that with my memory foam shoe inserts, but I found a way to dry them anyways. I've been wearing them for a day after the fact and they still feel dry and smell fine.
Step 1: Dry It With a Towel
The problem with foam is that the water gets stuck inside and doesn't have enough exposure to the air to be evaporated. So the first step is to get as much water out as possible. Lay a towel on the floor and put your foam inserts on top. Step all over the inserts with your heels to squish the water out with your weight. Move the inserts to a dry spot on the towel and repeat, until they are as dry as you can get them (I did this 7 times before the towel was dry underneath the inserts).
Step 2: Dry It in the Fridge
The last step is to get the last bit of liquid out of your foam. Refrigerators suck moisture out of the air through evaporator coils. Leave your soles in the fridge for a day.
When you are ready, take them out and allow them to warm up by themselves to room temperature. Don't put them somewhere too warm or else water will condense on them.
Hope this helps you save your foam things from yourself!