There are living creatures that you want in your compost bin such as microbes and red earthworms and then there are the creatures you wan to stay away like raccoons, rodents, and bears). A compost bin can be very appealing to an animal, easy access to food. As a rule, you should never put animal matter into compost (left over meat and bones) not only do they not make for good composting they will be a magnet to wild animals. Following are some more tips to help keep your compost bin free from pests of all sizes.
An odor-free compost bin is less likely to attract bears or any other animal friends. You can achieve this by rotating or turning the compost pile at least once per week. Another precaution that should be taken is to have a bin with a cover whether it is commercially made or one you make yourself.
Another thing you can do is to put brown food such as lawn clippings on top of the green food (food scraps and other kitchen waste). You can purchase lime at your local nursery or hardware store to sprinkle on the top of your composting materials that will increase the rate at which everything decomposes.
The location of your compost heap should not be near the edge of your property especially if you live near a forest or park area. This makes it very easy for animals to help themselves without being exposed by walking through your backyard.
If bears or raccoons are a big concern in your community you can look into a neighborhood compost pile. In addition to making composting more accessible to a larger group of people, you can look into an electric or barbed wire fence to ensure no unwanted animals come looking for a free lunch.