First and foremost you should start by playing with him in your place/backyard before going for a walk so he won’t be too energetic and excited. When playing, try to engaging him with his toys. Practice getting him used to playing with you and his toys until he becomes relatively tired.
Feed him well with his favorite food, and some treats while using this time to reinforce simple commands before going for walk.
Put him on leash, when you are ready to go for a walk, try not to walk in the places where he usually goes for random things he likes to try and eat that you don’t want him to eat – you don’t want to fight much if at all with his instincts and wanting to smell, so try to avoid “problem” areas at first.
When he shows interest/over-excitement for bird poop, dog poop, garbage (or whatever else, proceed to have him calm down. Pull on the leash slightly to the side to correct him, don’t make loud noises such as yelling his name, just something like “hey” or “shhht”, in a calm yet assertive tone, you should not being angry, frustrated or tense at all.
You can also tap him between the neck and the shoulder area, which will also help him to calm down and become distracted from focusing on trying to eat something that could be bad for his health and or to in time just get him out of this unwanted behavior all-together.
You should practice having him smell and then move about 10 feet away at first until he remains calm and slowly decrease the amount of distance and reward him positively when showing less and less interest in the garbage, random food out on the sidewalk or street.
From now onward (until the behavior is completely curtailed), you have to walk with him slowly around “problem” areas. Inching closer and closer to the trash or object. He should NOT pull the leash, you should maintain control, keep him calm and submissive. Have him walking by your side or behind you, not out in front of you.
If he is pulling, then gently pull on the leash to the side to correct him, stop and wait until he calms down, then one step closer. Go closer until you get to the point that you’re just a short amount of distance from the trash or object (but where he still can’t reach it), and let him sit down there. Just wait there for a little while. use positive reinforcement to reward and praise the behaviors you want from him.