To keep animals out of your compost bin, ensure the bin has a secure lid and is made of sturdy materials. Using a tumbler bin can also deter animals since it's elevated off the ground. Avoid adding meat, dairy, and oily foods to your compost, as these are more likely to attract pests. Regularly turning your compost can help bury any attractive scraps and reduce odors that might attract animals. Lastly, consider placing wire mesh or fencing around your compost area as an additional barrier.