If you want to get a little fancy (and who doesn’t?), grab a jar and roll a piece of paper into a cone. Tape the cone so it stays together, and stick the skinny end into the jar of vinegar.
This creates a one-way street for the flies. They follow the scent down into the cone, but they’re too dizzy to find their way back out. It’s like a tiny, smelly escape room that they always fail.
You can even use plastic wrap with poked holes instead of a cone—same idea, less origami. The point is, simple physics does the heavy lifting for you.