Living with urban wildlife
Raccoons are opportunistic, omnivorous (they will eat plant and animal matter), and are very good at getting into places where you may not want them.
The best way to keep raccoons from becoming a problem is to eliminate human-provided sources of food and shelter. Keep all human and pet food away from raccoons by keeping garbage in secure trash cans, putting compost in an enclosed container, and feeding your pets indoors.
If raccoons are raiding your garden, motion-sensitive lights, electric lights, electric fences, and making loud noises when they are present may deter them until you can harvest your crops.
Raccoons often seek shelter in chimneys, attics, and under porches and houses. During the spring and summer, assume that there are babies present, but in the fall or winter use the techniques described previously to get them to move away. After they have left, you can cover up all possible entrances to prevent them from returning.
for more info.