"Give a diesel engine clean fuel and it will run forever." This old saw is less of an exaggeration than you might think. Repair statistics show that 90% of diesel engine problems stem from contaminated fuel. The promise of eliminating 9 out of 10 potential failures should put fuel-system maintenance at the top of your list.
Start With Clean Fuel
Don't make your task more difficult by taking on contaminated fuel. The bad things that happen to diesel fuel inside your tank, which I am going to describe momentarily, also occur inside the supplier's storage tanks. That isn't a problem for you if the fuel is efficiently filtered on the way to the nozzle. If you have any doubts about the cleanliness of the fuel, pump some into a clean glass jar and let it sit a few minutes. Water and dirt will settle to the bottom. If you see either, filter the fuel before it goes into the tank, or better yet, buy your fuel somewhere else.
Keep Out Water
Gasoline engines can ingest a certain amount of water with the fuel without serious consequences, but if a single droplet of water in diesel fuel makes it all the way to the cylinder, the sudden steaming of the water can blow the tip right off an injector. This is the reason for having a water-separating filter, but too much water in the fuel can overwhelm this filter.
If you took aboard dry fuel, shouldn't it stay dry inside your tank? No. Contaminated fuel is only one way water gets into the fuel aboard boats. It also leaks in around the fill cap, it is occasionally driven in through a flooded vent fitting, and it forms inside the tank as condensation.
You already know to check any doubtful source to protect against pumping fuel aboard that already has water in it. But have you ever checked the seal on your deck fill? Some have O-rings (missing?), some have gaskets, and some depend on tight metal-to-metal or plastic-to-metal contact to seal. Fills located on side decks, especially on sailboats, can spend a lot of time under water and are often the primary source of water contamination. If the cap's seal isn't airtight, replace the gasket or the fitting.
Where is the tank's vent fitting? If it is on the side of the hull, deep heeling or heavy rolling might submerge it, admitting water into the tank. If it is through the transom, a following sea might drive water back into the tank. Even when it is located in the cockpit or on the cabin side, an errant wave can engulf it.
Water also condenses out of the air inside the tank. Due to the daily heating/cooling cycle, a small amount of moisture will condense out of the air every day. The more air in the tank, the more potential for condensation, so it is a good idea to keep tanks topped off, especially while the boat is not being used.
Like mold on bread, algae and fungi can thrive inside fuel tanks. These microbes require both fuel and water, so the drier the fuel, the smaller your algae problem is likely to be. However, keeping all water out of the fuel is improbable, so diesel fuel should always be treated with a biocide to prevent the growth of microbes. Avoid products that contain alcohol, which attacks O-rings and other rubber parts in the fuel system.
No matter how meticulous you are about the fuel you take aboard, dirt, water, and microbes — dead or alive — accumulate in the bottom of the tank over time. They may seem harmless enough just lying there, but the first time you are motoring in bumpy conditions, they get churned up and find their way to the fuel pick-up, either in small amounts or in big gulps. If you are lucky, this contamination simply plugs your primary filter and starves the engine of fuel until it dies — hopefully not at some critical moment. If you are unlucky, some of this debris finds a way past the filters and damages the injector pump ($$!) or the engine ($$$$!!).
It is advisable to clean out the tank periodically. How often depends on fuel quality and even tank material, but every couple of years you should at least draw some fuel from the very bottom of the tank to check for water and/or sediment. You cannot do this through the pick-up tube feeding the engine because it is an inch or so above the bottom. If the tank doesn't have a drain fitting or a clean-out port, you will need to find some other way to get a suction hose to the bottom.
Mobile services are also available that draw all the fuel out of your tank and circulate it through a filtration system. This is known as "polishing" the fuel, and done properly it removes the majority of the sediment from the tank. You can also plumb an electric fuel pump, filter, and return line into your fuel system to allow regular or periodic onboard polishing.
Proper fuel lines last a long time, but improper lines can shed internally and contribute to fuel contamination. Metal fuel lines are less susceptible to chemical deterioration, but the supply line connected to the engine must never be metal because movement and vibration will eventually cause the rigid line to crack. Flexible hose is unaffected by vibration and ideal for boat use. Makes sure the feed hose is Type A-1. If it is, that designation will be stenciled on the hose. Vent and fill hoses can be Type A-2. Fill lines should exhibit an uninterrupted drop to the tank as any dip that allows fuel to stand risks hose deterioration and fuel contamination.
There is a reason that the fuel filter mounted on a diesel engine is called the secondary filter. The engine manufacturer expects this filter to deal only with contamination small enough to have passed through the primary filter. Every diesel engine must have both a primary and a secondary filter, and the primary filter must remove water from the fuel. I prefer a primary filter with a clear sediment bowl, which should be inspected daily. Water in the bowl is visible evidence of water in the tank. If you need to drain the bowl (it has a plug just for this function) more often than every 100 engine hours, the tank needs cleaning.
Filters should be changed when they are dirty, but unless your primary filter is fitted with a vacuum gauge (which reveals the extent of restriction), you will need to change the element at some regular engine-hours interval. Your engine manual should specify. In recognition that the primary filter captures most of the contaminants, it is a common and generally acceptable practice to change the secondary filter element at every other primary filter change.
Too often the first indication that a tank is full is fuel flowing from the vent line. Such overflow, if it gets into the water, is both illegal and reprehensible. Simple, inexpensive systems are available to capture overflow. Fitting your boat with one of these will avoid embarrassment, the disgust of other boaters, and perhaps a significant fine.