If a fly has buzzed into your room, then open your door or window until it flies out, and then shut it again.

Once you’ve cooked a meal, put away any extra cooking ingredients or extra servings before you start eating, or they will attract flies. When you’re done eating, wash your dishes right away to keep any food particles from attracting the flies. If you’re putting food away, make sure all of the containers are tightly sealed. Obviously, fruit flies love overripe fruit or produce. Don’t leave your fruit out in the open – cover it with a muslin cloth bag.

If you need to leave the door open while you cook the meat, have a fan blowing at the open door – this will scare the flies away. If you’re having an outdoor barbecue, make sure to keep your doors and windows closed.

Make sure that your trash is properly bagged, too.

Basil. Grow a basil plant outside, near your room, and watch it keep out the flies. It will not only deter flies, but it will deter mosquitoes as well, and it can make a great addition to any meal. Bay leaf. You can grow it outside during the summer, but you should bring the plant indoors during the winter to scare off the flies. You can also just put a bowl of dried bay leaves in your room to keep the flies out. Lavender. Not only does lavender smell delicious, but it will scare off the flies. You can grind it into a powder and sprinkle it over your furniture, grow it in a container, or grow it in your kitchen garden. Mint. Place a mint plant in your room and scare away fleas, ants, and flies. Tansy. Tansy is another herb that is known from repelling flies, ants, fleas, and moths.