Maggots can appear in a garage if flies lay their eggs in warm moist materials such as garbage, rotting vegetables, and animal or human feces. To prevent maggots from appearing, it is recommended to keep the garage clean and free of any spills, ventilate the area well, and inspect the garage regularly for signs of infestation. Additionally, lemon or lime juice, boiling water mixed with bleach or white vinegar, and fly traps can be used to kill maggots.