There are various products you can buy in Garden centres but their effectiveness is debatable. So all these are organic, traditional methods:
Cover your borders with something so its not fresh soil (like gravel, thick bark mulch etc); because if cant dig over poops the cats will be upset.
Some plants deter cats such as Coleus; they are toxic to cats who eat large quantities but cats don't because of the horrible taste. And they are commonly found in the wild so they learn this young. The smell deters them.
If you cant win the fight, then redirect them to another part of the garden you are happy for them to occupy (Like a patio area, where they wont poop because they cant bury them). You can redirect with various cat attracting plants; like catnip. Don't worry you will attract a menagerie of cats because once one cat is in the area another won't enter its space without a fight. So a cat lying on the catnip will actually protect the rest of your garden from intruders.
Or if you have lots of money and are technologically gifted; then somehow make a motion sensor activated sprinkler. Two birds with one stone; watering and cat deterrent.
Or just buy your own cat. It will protect its territory and they usually wont poo on its territory so as not to attract predators. So you get all the cat love without any of the poop. Terribly ironic I know.