Shimmy the pry bar between the baseboard and the wall, and gently press down on the handle of the pry bar to pull the baseboard away from the wall and the window. Use the hammer’s claw to pull out the nails in the baseboard once they’ve been pried away from the wall. Remove all the nails from the baseboard and remove the baseboard from the window.
Shake the can of foam insulation and put the straw on the end of the sprayer. This focuses the spray in the exact area you want. Spray the insulation in the crack between your window, the wall and the baseboard. Only spray a small amount of insulation since it expands.
Allow the foam to dry completely. Cut any excess foam off of the walls with a utility knife.
Place the baseboards around the window and hold them in place with one hand while you hammer new nails into the baseboard and wall.