If you find that your fountain has developed noticeable algae, the first thing you need to do is thoroughly scrub the individual components of your fountain. Take your fountain apart and clean each surface using soap and hot water and allow to air dry before reassembling. Wipe down the fountain with distilled white vinegar or a solution of 1 cup of bleach per gallon of water before soaping and rinsing the fountain. Rinse bleach thoroughly. Unlike preventative treatments, algaecides are meant to kill off existing algae growths within a fountain. Algaecides are available in home improvement stores as well as online and specialty retailers.  Check the algaecide bottle to see how to properly use the product. Check the bottle to see how much product should be added to the water and at what frequency. Non-metallic algaecides work better in fountains as they are less likely to stain. If heavy algae growth continues for extended periods in your fountain, consider replacing the pump to get better water movement and circulation. You may be able to do this yourself, or you may want to call in an expert depending on the size of your fountain and your level of experience. Fountain pump systems can differ greatly. Check with your manufacturer to see what components your fountain requires.
Scrub your fountain. Use an algaecide. Replace your pump.