its easy but please note maggots are no pill bug they are dangerous in ways they (can) burrow into your skin and cause vital organ damage but on the bright side they are used for medical treatment.
what they eat:maggots eat apples or any other kind of food including dead bodies.
Maggots have to feed from several days up to several weeks, which is why they are not too eager to leave their birthplace. After they are done feeding (and only when they are done feeding), they will migrate to a dry place, typically outdoors, to hatch into the adult fly, beetle, or moth.
where do maggots live?:Dark and moist places. they can also be seen in something that they can eat when they develop into adult flies. That is why you always see them in animal carcasses and rancid meat.
where you can find them (if you want any more in the future):animal carcasses, rancid meat, any kind of fruit, in your garbage etc.
hope this helped-josh