Flies are a problem, especially when they contaminate food. Despite the fact that common house flies do not bite people, they can spread diseases and pathogenic microorganisms, incl. salmonella, malaria and tuberculosis. Fruit gnats are smaller but can lay up to 500 eggs on the surface of food. Preventing flies from entering your home is just as important as getting rid of them. Exterminate flies with a homemade or store-bought trap.
Steps
Method 1 of 3: Exterminating flies with home remedies

Step 1. Set up a dish soap trap
Pour liquid soap into the jar to the level of 2.5 cm and add another 2.5 cm of water. The flies will be attracted to the soap and drown in the water.
- Use fruit-scented dish soap for best results. For example, an apple or lemon-scented soap may work better.
- Add 1 or 2 drops of apple cider vinegar if you notice that not many flies are trapped. The vinegar will attract flies to the jar.

Step 2. Knead the natural fly repellent in a spray bottle
Flies prefer to stay away from the smell of cayenne pepper. Mix a small amount with water in a spray bottle.
Treat doorways, frames, and other places where flies can slip into the room with this mixture. The scent of cayenne pepper will make them stay out of the way

Step 3. Plant some grasses to repel flies
They don't like the scent of lavender, basil, mint. Set up a herb garden in your kitchen, or use fly screens to keep them out.
Plant calendula if you prefer flowers to herbs. Marigolds are unpleasant to flies

Step 4. Outsmart the flies with water bags
The way the water in the bag reflects the light is like a spider web, which flies try to avoid.
- Fill a half clear bag with water. Tie and hang near doors and windows.
- Hang up old CDs or DVDs to achieve the same effect.
Method 2 of 3: Getting Rid of Flies with Commercial Traps

Step 1. Look for disposable fly traps at household supply stores
Traps can be found that attract flies with non-toxic bait and collect up to 2000 flies.

Step 2. Purchase sticky paper
It can also be found in hardware stores, supermarkets, and home improvement stores. The flies will stick to the paper and will not be able to fly away.
Remove and discard the sticky paper when too many flies accumulate on it. It not only becomes less effective in this form, but also more unpleasant to look at

Step 3. Consider purchasing a fly deterrent lamp
You can purchase a fly repelling lamp in your kitchen or home. Many restaurants use such devices.

Step 4. Use insecticides carefully
They are often dangerous to people and pets. Try as many non-toxic products as possible before using the poison.
Method 3 of 3: Preventing flies

Step 1. Keep trash covered
Flies are attracted to debris, especially decaying food.

Step 2. Throw away fruits and vegetables before they are too old to eat
If possible, store them in the refrigerator, not just in the kitchen.

Step 3. Thoroughly wash floors and countertops
Do not leave crumbs or spills.

Step 4. Check the seals and insulation
Doors and windows should be tightly closed to prevent flies and other insects from entering the house.