Try spraying the intruder with a blast from the hose. Most cats will turn and run although some actually enjoy water, especially on a hot day. For them, you must try other tactics, like planting rue. The blue foliage makes this an attractive garden accent, but cats can't stand the odor and will make a wide berth around the planting. Thorny roses also deter cats.
Some gardeners use homemade remedies.
Although I can't personally attest to the success of these methods, it won't hurt to try them. Sprinkle your plants with crushed pepper. It will irritate cats and may even produce a few extra pepper plants in the garden. Cayenne is also said to work though you will need to reapply it after every rain. Or try ground-up grapefruit and lemon rinds.