Be more wary if walking with a dog. Don’t let of the lead and where possible, steer out of their way.
Sorry, this is catastrophically dangerous advice.
If a herd of cows is running at you, let the dog off the lead straightaway. The cows are heeding their anti-predator instincts, and to them the dog is a wolf. If they have calves with them they will do all they can to trample and kill it.
You, on the other hand are a human, the same sort of thing that feeds and milks them, so not a threat. The dog can make its own way to safety faster than you can, and if you hang onto it they’ll trample you as collateral damage.