If it gets aggressive with you, calmly yell, “Stop,” “No,” or “Back,” to make it back off. Never run away from an attacking dog, since this will encourage it to chase you. Consider carrying a dog whistle or regular whistle while you walk, which should frighten it and make it run away.
How do you stop a dog from being aggressive when walking?
If a dog exhibits a reactive behavior (lunging, barking, growling) during a walk, the owner should immediately turn and briskly walk or jog out of the situation. The owner should be firm and calm and not yell, scold, give a leash correction, or punish the dog. Stranger petting.
Why does my dog attack me when walking?
Causes of human-directed aggression are varied, yet the underlying motivation for the dog is usually fear or anxiety—not a desire to be dominant or control. Dog bites and canine aggression result from many factors (Table 1), and may be a normal but unwanted response, or an abnormal response, to a particular situation.
Why is my dog aggressive with other dogs on walks?
Aggression between unfamiliar dogs can be due to fear, poor communication, defensive, possessive behavior over resources (including perhaps family members or other pets) or territorial behavior over territory or owner. Aggression between dogs can result in injury to dogs and/or to the people trying to separate them.
How do you handle an aggressive dog on a leash?
Turn to Treats to Distract. In the meantime, start decreasing your dog's frustration when he's on leash and spies another dog by removing the tension from your leash. To do that, you're going to teach your dog that when he sees another dog, he'll be rewarded for looking at you.

Below are two helpful articles on a similar topic 👇
How do you protect yourself while walking your dog?What do you do when your dog approaches your dog unleashed?