When flies land on your food they actually vomit on your food.
The flies will vomit or throw up an enzyme that the flies use to help them break down the food they eat.
So when the fly lands on your food they throw up the enzyme on your food which is gross.
You may not be able to see the enzyme that the flies throw up but it's there.
So if you have food out and flies are around you should really cover the food up to prevent spread of disease and germs.
I have however eaten food that flies flew on during a picnic before and even in my house and never got sick from it.
So for me it's not that much of a problem but for some people it could be.
I've also had flies land in my coffee and other drinks and I just remove the flies and drink the coffee or other drinks and never gotten sick.
Flies also land in poop as well and could spread that poop bacteria to your food or drink.
So if you're worried then throw the food out or dump the drink but you're unlikely to get sick from it.