Loosen and scrape weathered or cracked sealant from around the chimney and flashing joint with a utility knife and putty knife. Use the utility knife's sharp blade to cut partially adhered chunks of sealant from the joint, and use the putty knife's broad-edged blade to scrape flush against the chimney and flashing.
Wipe loose debris and sealant from the joint with a rag. Clean the joint and adjacent surfaces with a rag and cleaning compound. Allow the work surface to dry. You must clean the work surface prior to sealing; new sealants sometimes fail to adhere to dirty surfaces.
Puncture the protective film inside the roof caulking or sealant tube's nozzle with a nail or the puncture tool attached to the caulking gun. Pull the caulking gun's rod away from the gun to clear the gun's chamber. Load the tube into the caulking gun. Pull the gun's trigger to set the rod's plate against the rear of the caulking tube.
Place the tube's nozzle near the joint between the flashing and chimney. Lightly press the nozzle against the joint and pull the gun's trigger to release a thin stream of caulk, called a bead. Run the bead of caulk around the chimney along the joint. Set the gun aside and smooth and compact the bead of caulk into the joint with a putty knife. Apply additional beads of caulk to other problem areas, including the joint between flashing and shingles or around the base of the chimney.
Open a tub of roof caulking or sealant. Scoop caulking or sealant from the tub with a putty knife. Spread sealant across the joint between the chimney and flashing, between the flashing and shingles or the chimney's base. Apply sealant in smooth, flat layers to avoid creating gaps, valleys or depressions that will hold water.