Remove the debris from cracks or holes with a chisel. Scrape out any loose concrete. Even small particles will interfere with the seal of the foam once it is sprayed.
Shake the can of foam sealant thoroughly for at least one to two minutes. Failing to properly mix the sealant will result in a runny mess.
Hold the can upside down, and aim the nozzle into the crack before you spray. Do not spray with the can in the upright position.
Release the foam into the crack or hole. Use an even amount of pressure on the can's trigger. Do not overspray. Fill the hole or crack, and then let the foam set until it is hard to the touch -- typically eight to 10 hours, depending on the humidity in the room.
Trim any foam that has expanded beyond the patched area with a utility knife. Use the knife to shave the excess off until the patch is level with the rest of the wall.