How to Compost Food and Bad Produce. Even with the best of intentions, some fresh produce will still spoil before you can eat it. Since it can attract annoying fruit flies, it’s imperative that you take care of it quickly. I use a countertop compost bucket and empty it every couple of days. It’s easy to clean, but to make it even easier you can get compostable bags. Just remove the bag, and toss it in your compost pile. You can also use overripe fruit and vegetables to make cold process soap.