Step one is ruthless. You have to remove their food source entirely. I’m sorry, but that sad bunch of bananas with the brown spots? Into the bin. Take it outside. Don't argue with the banana—it lost its right to exist.
Check your recycling bin. That empty wine bottle with a film of red left inside? That’s an all-you-can-drink buffet for them. Rinse everything. Every can, every jar, every takeaway container that smells vaguely of the weekend.
And please, for the love of all that is holy, take out the kitchen bin more than once a month. I know you’re busy, but so are the flies. They’re clocking in overtime.