That’s the problem though isn’t it. Assuming trash will never be without electronics, batteries etc, it will end up in water. As far as I understand, burning in decent facilities should keep most nasty stuff out of the atmosphere and ground water (e.g heavy metals)
Since the late 80's, American landfills are required to be lined and equipped with water treatment facilities to preven groundwater contamination. Doesn't completely eliminate the risk of course.