Some of your leftover food can be added to compost, but there are some things that you’re better off repurposing in a stew or simply throwing out with the trash. Leftover fruit and vegetables, whether raw or cooked, can always be used in compost. You can compost fruits and vegetables even when they’ve spoiled and gotten moldy. (Consider it a head start on the decomposition of the compost heap.) The peels and trimmings from your fruit and vegetables are also fair game for adding to the compost bin.
Other food products you can use in composting include coffee grounds (along with the filter), tea leaves, and leftover beer, wine, or fruit juice. All these leftover food items function as nitrogen-rich “green” materials in your compost. Eggshells, stale herbs, and shells from all nuts except for black walnut can be composted, too, and those serve as carbon-heavy “brown” ingredients. The black walnut must be avoided at all costs because it is toxic to other plants. Leftovers can entice pest animals to scope out your compost bin as a source of food if they’re left lying on the top, so it’s best to tuck any leftovers you add to your compost under the top layer to hide them a bit.
As you can see, there are lots of leftovers you can compost, but keep in mind that leftover food products that contain meat, fish, dairy, or grease should not be used in compost. These foods are notorious for attracting rodents and other pest animals, not to mention they’ll cause your compost to stink.
You’ll sometimes see recommendations not to compost bread products, but as long as they’re added in moderation, the compost container lid is closed, and the bread products are buried under the existing compost instead of left on the surface where they’ll attract wildlife, it’s fine to add them to the mix. The concern with bread products is that they can be particularly attractive to pest animals, but as long as you take precautions, they’re entirely safe to compost.