Your dog should have been introduced to leash work and this should be something that you are currently working on. This exercise is not where you start, but it is a tool to get you where you want to go.
Wherever you take your outdoor walk. It does help if you know the area, but it’s not critical.
This isn’t about giving out treats, although I still want you working on clicking and treating for attention during walks and reinforcing good positioning, so treating where you want your dog is ongoing.
This addition to your current walking exercises will strengthen them without additional treats. Getting to sniff is the reward for walking nicely.
Walk your dog at least 5 minutes, 2-3 times a day.
You will see your dog ignoring the areas he wants to sniff more and more. Your dog knows that you are going to let them sniff it if they walk nicely. Be sure you do!