To keep cats out of a garden, lay down chicken wire in a planting bed above the soil before planting crops or flowers. Cats do not enjoy walking on chicken wire and are unlikely to attempt it a second time.
There are other ways to deter cats from entering a garden. One of the easiest ways involves making strategic use of water. Cats hate getting wet and avoid gardens where a hose is being sprayed or a sprinkler is turned on. There are also sprinklers that go off when a cat or other animal is present. Plants that deter cats from entering a garden include the coleus canina, pennyroyal, rue and lavender. Sprinkling substances like mothballs, cayenne pepper flakes or dried blood fertilizer also keep cats away.