The best way to prevent an infection of Legionnaires' disease is to quit smoking. The damage smoking does to your lungs weakens your defense against infection when you are exposed to the bacterium legionella. Active alcoholism is another risk factor.
Another way to prevent an infection of Legionnaires' disease is to avoid large or unclean water sources such as public fountains, hot tubs, and cooling systems. The bacterium legionella is transferred through inhaling contaminated water droplets in the form of a mist or spray, so a thorough cleaning of household water systems will also help prevent the bacterium from spreading. People with compromised immune systems (such as those who have received transplants), or suffer from kidney problems or diabetes, long-term lung problems, or cancer need to be especially careful to avoid legionella.