When organic matter decomposes in the presence of oxygen — as it does in aerobic composting processes — it releases carbon dioxide.
When organic matter decomposes without oxygen — as it does in most landfills — it releases methane. Methane emissions from landfills are about 30% of the total methane emissions in the US. (fact check)
Compost food waste and other compostable materials whenever possible so that the less-potent GHG is released.