the lid closed.
You can also place materials like salt, lime, or diatomaceous earth at the bottom of the bin to make the environment less attractive to flies. Citrus peels or strong scents may also help discourage them.
Maggots may look frightening, but they are simply nature taking advantage of available food. With a few simple habits, your trash can can quickly return to being just a normal place for garbage.