One of the most effective ways to keep cats out of your yard is to install a physical barrier. This could be a fence, wall, or even chicken wire.
Motion-activated sprinklers are a great way to deter cats from your yard. When a cat approaches the sprinkler, it will be triggered and spray them with water.
There are a number of scents that cats find unpleasant, such as citrus, peppermint, and lavender. You can spread these scents around your yard.
When a cat approaches the device, it will be triggered and emit a sound that will startle the cat and make them leave.
Cats are territorial animals, so they're less likely to enter a yard if there are other animals present.
Cats are attracted to yards that are messy and have plenty of hiding places. If you keep your yard clean and tidy, there will be less for cats to attract them to.
It may take some time and effort to keep cats out of your yard. Be patient and persistent, and eventually you'll be able to enjoy your yard without having to worry about cats.