Cherry fruit fly control

What is the best way to control and prevent cherry fruit flies from laying eggs in cherries? They infested quite a few of my back yard cherries with eggs (and the worms/larvae that hatch from them) last summer (2019) and…