The final, and most efficient way to prevent corrosion is to design your component or process to eliminate or reduce the possibility of corrosion. Some of the things to avoid are:

Fluid systems that are open to the air, this allows oxygen to dissolve in the water, increasing corrosion.

Crevices. Joins which require fasteners (e.g. bolts) usually create crevices. Welding is a better alternative, however, the weld shape should be monitored to ensure no crevices are present. Sensitisation is also an issue.

Stagnant areas in liquids, because they can lead to galvanic corrosion.