This is a test of commonsense. Complete the next sentence:

How to discourage dogs from pooping in your garden
Put up a fence.
Perhaps the most obvious solution, if not the most cost effective, is simply fencing in your garden to keep dogs out.
Make sure your fence is in line with local property laws.
Ask neighbors or go to city hall and check in with officials. Fences can be an expensive option, but might be worth it if the dogs are not easily deterred.