Moss grows in moist areas on your roof. Clean your roof once or twice a year to remove any debris and leaves that can hold moisture. Prune overhanging branches that provide too much shade to the roof.
Moss can often be removed with a stiff push brush or wire brush.
If you must use chemical cleaners, use the minimum recommended concentration and redirect roof cleaning water to the sewer system or vegetated areas where they have time to infiltrate and be broken down in the soil. Do not reconnect downspouts until the chemical residue cannot be seen on the roof any longer, or about three rain events. Treat your roof in dry weather so that the treatment has time to soak into the roof. These chemicals will only kill the moss, not remove it, so you will have to remove the moss from your roof to prevent damage. It may be just as easy to remove the moss without using a chemical treatment.