Americans throw away 40 million tons of food each year. That number rose during the coronavirus pandemic. Many families have been cooking more frequently at home, which means more food purchased and more food wasted. This is a big problem for the environment. Food garbage is taken to landfills. As it rots, it gives off methane, a powerful greenhouse gas that is worsening climate change.

The most obvious way is to stop wasting so much food. That might mean buying fewer vegetables than we can eat in a week. Or storing fruit in the fridge so it lasts longer. Or freezing leftover dinner if we won’t eat it before it goes bad.

Beth Simone is a big fan of composting. She is the development and marketing director of the Compost Research and Education Foundation in Raleigh, N.C. Many more Americans got interested in home composting this year, Simone says.

To compost, you collect leftover food scraps such as apple peels, eggshells and bell pepper seeds and stems. You mix them with leaves, grass clippings and twigs. As they decompose, fungi, bacteria, insects and other organisms turn them into rich organic matter. That’s compost. Applying compost to your soil helps put nutrients such as nitrogen and phosphorous into it.

Composting not only keeps food out of landfills, it also “makes healthier soil that helps to grow better vegetables and flowers,” says Simone. “You can see the benefits immediately.”

If you have a yard, find an out-of-the-way spot where your food waste can go. It might be smart to buy a special box that critters can’t get into. Mix in the right ratio of food and yard scraps. A simple rule is 2-to-1 brown (leaves and twigs) to green (fruit and veg). Don’t put animal products such as bones and cheese rinds on the compost pile; they take too long to rot.

No yard? Start a vermicompost box inside. That means worms — in particular, special composting worms called red wigglers. You’ll also need a large, flat plastic box with a lid, newspaper to line it, and a dark area between 55 and 75 degrees.