To keep raccoons away, create a repellent spray by mixing together 2 quarts of water with 1 chopped yellow onion, 1 chopped jalapeno pepper and 1 tablespoon of cayenne pepper. Boil the mixture, let it cool, and strain it through cheesecloth into a spray container. Spray in the garden and around garbage cans and the outsides of buildings, repeating every five days until raccoons move elsewhere. Ammonia sprayed around the perimeter of the garden is also an effective raccoon deterrent.
Because strong spices irritate a raccoon's sense of smell, a liberal sprinkling of ground dried hot pepper, ground black pepper or cinnamon discourages raccoons from scavenging in garden areas wherever the spices are applied.
For vegetable gardens, construct a fence of chicken wire or a similar lightweight hardware screen, stretching the lower portion across the fence poles and securing the corners. Leave the fence portion at the top unsupported by poles, slightly bending back the floppy part so it leans away from the garden. A raccoon can't climb over the fence if the unsupported portion doesn't support its weight.
To deter raccoons, soak a rag in a bowl of apple cider vinegar overnight, and place the rag where raccoons are a problem. Clean and disinfect garbage cans with equal parts warm water and white distilled vinegar. The residual smell encourages raccoons to move elsewhere.