The answer to 'how to repair flashing' is to inspect and reseal any damaged or loose flashing around roof penetrations, edges, and joints. This includes flashing around chimneys, vents, dormers, and roof valleys. Start by carefully removing any old, cracked, or peeling sealant. Then clean the area thoroughly and apply a high-quality roof sealant or flashing cement to create a watertight seal. For more extensive damage, you may need to replace the flashing entirely.
It's important to address flashing issues promptly, as even small leaks can lead to costly water damage over time. If you're not comfortable working on your roof, it's best to hire a professional roofing contractor to inspect and repair the flashing properly.