Pour boiling water over maggots to kill them instantly. The water should be as hot as possible and poured directly on the maggots. It should also be poured into difficult-to-reach areas to ensure that all the maggots have been killed. Add 1 cup of bleach and 1 1/2 cups of hydrogen peroxide to a gallon of boiling water for extra killing power.
Spraying insecticide is an effective way to repel maggots and prevent them from entering a home or devouring fruits and vegetables from a garden. It is important to read labels to ensure that the type of insecticide used on crops is not harmful to crops and humans.
Ground rock powder, known as diatomaceous earth, is a more natural solution for getting rid of and preventing maggot infestations. The rock powder can be found at most local garden centers. Salt, vinegar and lime are also effective methods of killing maggots in a garbage can. Wipe the can with vinegar and water to prevent them from returning.
Using baking soda does not kill or prevent maggots from infesting an area, but sprinkling it on an area that has already been cleaned of them helps remove the smell that they leave behind.