Take out the trash regularly. Remove trash from your home at least every other day, particularly if it contains decaying meat, as the scent tends to attract more flies. Also, keep the lid closed tightly on any open garbage can, as flies need an entry point to lay their larvae.
Pour hot water into the trashcan, as maggots cannot survive in this type of environment and it kills them instantly. Afterward, pour the dead maggots into an empty trash bag, tie it up and discard it in the nearest Dumpster, if possible. If they are on your kitchen floor, sweep them into a pile, place them in an empty trash bag and throw it away.
Scrub the inside of the trashcan with hot, soapy water. You can also use a solution of one part vinegar to two parts water.
Dry the garbage can thoroughly in the sun before placing a new trash bag in the can. If you can maintain a dry, clean garbage can, you've won half the battle because maggots thrive in warm, moist environments.
Use a sponge to wipe down the trashcan's exterior with mint oil, vinegar or eucalyptus as these products are known to repel flies.