Always keep the kitchen clean, cover food containers and the trash can. This will reduce the arrival of flies.
Pour water into a spray bottle, add a few drops of essential oils like lavender, and spray it all over the house. This will prevent flies from coming.
Cut a lemon into two pieces, stick cloves in it, and place it in the kitchen. The smell from it is not liked by flies. They will not come to the kitchen.
If you mix vinegar and a few drops of dishwashing liquid in a bowl and keep it in the kitchen, the flies will die from the smell.
Pour water into a spray bottle, add a little vinegar to it, and spray it all over the kitchen, the flies will die.
If you keep a basil plant in the kitchen, the strong smell from it will drive away the flies.