Using a good fuel conditioner/stabilizer makes a huge difference. Best ones have a biocide, increase combustion efficiency, slowly dissolving sludge, add lubricating qualities, help filters separate water, corrosion inhibitor, besides stabilizing the fuel for a year or more.
If you have an engine that returns a small amount of fuel to the tank, a pump for polishing will help. It needs to draw thru a primary filter like a Racor that separates out water. Preferably a turbine. If your primary filter is rated for the engine's flow plus the pump flow rating, then you can run them both at the same time.
Using a conditioner with a polishing system or an engine that returns a high amount of fuel to the tank, your tank will slowly be cleaned of sludge and water. The sludge won't quickly clog your filter, but dissolve over weeks or months. In the end, with care, your tanks will be clean.
The conditioner I use (Archoil 6200) costs about 9¢/gallon. It gives me 6% better mileage besides all the other benefits. I cruise at 10 knots and burn about 9 gallons, or about 8.4 gallons using Archoil. So every hour I save about $1.50 worth of diesel for about 35¢. Conditioners pay. And there's a newer type (AR6500) that's advertised to increase mileage 11% I haven't tried yet. My tanks are clean, and I can go inside, walk around, and verify that. I run 2 micron primary filters, have really clean fuel and haven't changed an injector, fuel pump, or fuel system part in 10 years.