Pull the nozzle on the can of spray foam. If the nozzle doesn't easily pop off, twist it and try pulling it again. If you can't get the nozzle to pop off of the can, skip Step 2 and proceed to Step 3.
Fill a bowl with hot, soapy water.
Set the nozzle from the can of spray foam into the bowl of hot, soapy water. Allow the nozzle to sit in the water for 10 minutes to loosen the mold from the surface. Remove the nozzle from the water and brush it with a toothbrush. If the nozzle is still on the can, run it under hot water and wipe it down with a toothbrush.
Rinse the nozzle under hot water. If the nozzle is off the can, set it in a strainer and run it under hot water for five minutes, helping to remove the soap and any remaining mold from the nozzle. If the nozzle is still on the can, simply hold it under the hot water for five minutes.
Dry the nozzle and replace it on the can or dry the nozzle while it is still on the can.