You hang it out behind a shed or garage, the lid has a little maze that they crawl into and then they can't find their way out.
My parents always used https://www.bigstinkyflytrap.com/ . It definitely caught a lot of flies, which can be different than catching enough flies of course.