I asked experts how to tell when food is safe to eat—and when it’s time to toss it.