We do not have public garbage collection where I live. You can hire a garbage collection service or take the garbage to the dump yourself, which is what I do.
The other day as I was about to put the trash bags into the trunk of my car when I saw them. I went back into the house for more trash bags to double bag the garbage. I did not want those nasty looking things in my car.
The maggots appear in warm weather if you don't dispose of the garbage sooner than usual. I routinely go to the dump once a week but now while it's hot I'll have to go twice a week to avoid having it happen again.
(photo from web)
Flies lay eggs that become maggots. Thankfully I almost never have flies in the house. It's the trash can that's a problem. I have a metal trash can with a tight lid so I have no idea how flies can get in there.
Here's a great video:
"While these flies are major pests within the home, they are one of the only organisms that rids the world of carcasses. When they are in their natural habitats, they are very helpful, indeed!"
(Jordan from Norman, OK)