Expanding foam is used to fill gaps and improve insulation viability. It hardens as it dries and is difficult to remove from any surface without the aid of tools. There is no way to dissolve the foam once it has cured; however, if you get to it before it completely sets, then you can easily remove the foam and clean it off.
Connect the can of foam solvent to the foam dispenser as you would a can of expanding foam. Do this as soon as you are through using the dispenser. Spray the solvent from the dispenser by squeezing the handle. This will dissolve the foam from the dispenser valve so that it doesn't clog.
Spray the foam cleaner out of the can directly onto the expanding foam where you spilt or made a mistake. You must apply it before the foam hardens or it won't work, so it is best to clean it up the second you notice the error.
Wipe the expanding foam up where you applied the cleaner. Use gloves to protect your skin and rags that you don't mind throwing away.
If you wait until the foam has hardened, it can still be removed. However you will need to use a knife and scrape to cut the foam away and from the surface. There is no other way to remove it once it cures. Keep this in mind when you apply the foam. Don't put it somewhere that you might need to remove it from later.