I've used garden hose - just aim up, so that a few drops land on the ground near them, then closer as needed.
I've used an umbrella - I opened the door just far enough to get the closed umbrella out, then opened it. All the time while they could not see me.
I've tossed light, visible or noisy things between them and the area I want them to avoid.
I've herded them away from where I don't want them - with arms or pool noodles.
You have to be there enough of the time or they will either learn the pattern of when you are there or try it often.
You have to be creative, because any given thing becomes a normal part of the environment. But the more more types of things are tried, the more different a new thing needs to be to work at all.
It works best if you get the timing right - deterring at the point where they are feeling insecure as they venture into new territory (literally or something like trying a new plant in the garden).
It is a lot of work and ultimately doesn't work unless they don't really want to go there anyway. At least, not much more than the other places they can get to. So making other places very attractive helps.
Basically, it is like keeping predators away or critters out of a garden.
The other option is to call them away from where you don't want them. That ultimately doesn't work either because they figure out how to work the system - get you to call them more often if you offer rewards of some sort at least some of the time. Or, if you don't offer rewards often enough, they learn to not come when you call.
I do it because I find it fun to interact with them and learn about them. And I want to let them range as much as I can and still keep peace with the other people in my house by not having poop next to the house. Also, keeping them out of the road.