Use a water bag
Some people think that flies will fly away when they see an enlarged image of themselves in a bag of water and will go away. But most hypothesis people think that flies being scared of light refraction is the most typical explanation. When light is moving at an angle between two transparent materials, the phenomenon known as light breaking causes the light to change direction. In orbit, a water-filled plastic bag would act as a converging lens that bends light. That is why flies, notably fruit flies, will be perplexed and flee as a result.
Refraction of light has the potential to confound insects, particularly flies. Each fly's eye is composed of 3,000 to 6,000 tiny eyes due to its unique eye structure. These eyes allow flies to see in all directions at once, so the refraction of light has a strong impact on their vision. No matter how effective it is, there are still many people and restaurants that apply this simple method of repelling flies.