Use camphor
Camphor is one of the simplest and least labor-intensive methods for killing fruit flies inside. Camphor can help you effectively and permanently keep flies out of your home by repelling several common insects. Place camphor in areas where the smell is diffused, where there are lots of flies, or in hot areas so that it spreads a potent smell, effectively repels flies and prevents insects from approaching. You can also dissolve camphor in a bowl of warm, hot water and place it in areas where there are lots of flies to effectively repel flies.
Use camphor (mothballs) to keep fruit flies out of your home. The process is really easy; you simply place a mothball in a water bottle and poke a few holes in it so that the smell can escape. Since insects and flies frequently dislike this fragrance, they will typically flee. Flies will be deterred and kept away by the camphor seeds' potent, distinctive aroma. As a result, applying camphor to deter flies at home is thought to be helpful. However, avoiding using this anti-fly technique on pregnant women as camphor might have negative effects on the mother and the unborn child's future development.