Carry protection.
Depending on where you are walking, choose a way to protect yourself. You may choose to carry a large stick, a dog whistle, dog deterrent spray, or a stun gun. You can purchase commercial products that are proven to deter dog attacks. Look for a whistle that irritates dogs.