Fetching details from the dictionary...

to defend against; to protect against
to prevent; to avert; to avoid
風邪を防ぐにはうがいが大切。
Gargling is important to prevent colds.
交通事故を防ぐために常に注意しましょう。
I pay attention to prevent accidents.
堤防を築いて洪水の被害を防いだ。
They built a levee and prevented flood damage.