Guard against (someone or something)

To take care to avoid someone or something.

When we go to the beach we must guard against the hot sun.