There's a caption to a cartoon in the July 5 issue of the New Yorker that reads, "That which doesn't kill you might give you stomach trouble." And of life's most educational episodes, one lesson you really don't want to learn is what it feels like to experience all the parts of your digestive system at the same time.
Avoiding food poisoning is complex (the p.c. term now is "foodborne illness," lest we start tainting the deli guy as a "poisoner"), but it can be largely boiled down to a few key points about how bacteria grow, taught to us by our friend Fat Tom.
Fat Tom is not, in fact, a person, but a mnemonic device used by the National Restaurant Association, for whom wit and cuteness don't come easily. (Its literature contains earnest warnings against foods that have been "time temperature abused," and warns against getting your customers sick with an illustration of a judge's gavel banging on a stack of cash.) But it is good at telling you how to keep bacteria from growing on your lunch. So, Fat Tom helps you remember what makes a bacteria-friendly environment and how to avoid creating one:
F is for Food: Bacteria need food to grow. They specifically feed on protein and carbohydrates, so things like roast beef and mashed potatoes are tasty, tasty to them. (But things like dry salami and bread aren't, particularly -- see "moisture" below.)
A is for Acidity: Acidic ingredients are a natural preservative because bacteria really don't do well in pH lower than 4.6. So that means that foods high in acid (click here for a huge list) aren't really bacteria bait and, if you use lemon juice, vinegar and the like to season your food, it will also help it stay safe. (But, unless you're pickling something, don't rely on it to keep food indefinitely.)
T is for Temperature: The inartfully named "Temperature Danger Zone" is the range in which bacteria flourish, and it's 41º F - 140º F (5º C to 60º C). For storage, keep your food either below or above these temperatures. (The latter obviously being mainly while you wait to serve them.)
T is for Time: Frankly, without equipment or at the very least a handy stack of charts on you at all times, most people aren't going to know the specific acidity, temperature or level of moisture in a food, so the one really strict objective measure you can go by is time outside of the fridge (time in the car on the way to the potluck counts!). The official line is four hours; after four hours, if certain illness-causing bacteria have colonized your food, they may have bred to the point of making the food unsafe to eat.
But note the qualifiers in that sentence. Don't tell the lawyers I told you this, but it's worth noting that the restaurant industry's official line is based on somewhat conservative assumptions. It's possible that dangerous bacteria didn't land on the food until three and a half hours after it left the fridge. It's possible that the vinegar in the sauce is somewhat slowing the growth of that bacteria. It's possible that your food was so cold to begin with that it didn't actually get up above 40 degrees until an hour after you took it out. (And many other countries and cultures have different standards, ostensibly also based on science.) And so on. So you have to make your own choices, but restaurants in most states are supposed to throw out food that's been out of hot or cold storage for four hours.
Oxygen: Most bacteria that will make you hate your digestive system need oxygen to survive. So foods that are vacuum packed, properly canned, or even completely submerged in oil, for instance, are greatly protected. But there's a hitch: Botulism, the most heavy-metal sounding of all the food poisoners (yes, even more than listeria or clostridium), only breeds in oxygen-free environments. It's quite rare, and properly cooked, canned, pickled or dried food almost never has it ... but it has the distinct disadvantage of actually being able to kill you.
Moisture: At the top, we mentioned dry salami and, obviously, bread as being safe to eat without refrigeration, and it's because bacteria need moisture to survive. Drying food is one of the oldest forms of food preservation we have. So properly dried and cured foods are fine almost any time -- and don't mistake oil or fat for "moisture," since we're talking specifically about water.
So that's Fat Tom. But, you might ask, what's all this talk about bacteria? What about viruses and molds? The fact is that most viruses transferred through food are because of unsanitary handling and human error -- not washing hands properly and so on, and storage temperature has nothing to do with them. And the thing with molds and other spoilers is funny, because even though they're the ones that tend to make your food taste or smell bad, they don't really tend to actually make you sick, aside from being nauseatingly repulsive. (Except that if they've had time to grow, probably bacteria has, too.)
Oh, and a little addendum on fruit: Lots of things we instinctively keep in the fridge we really do so for freshness or crispness, not safety, per se. So most whole fruits and vegetables are fine to eat, in terms of tummy turmoil, if left out -- but if cut open, without its protective skin, they should be stored in the fridge.
Finally, a thousand words into this thing, I realize this list may read more as a compendium of things to be afraid of rather than something that empowers you. For the most part, though, I think that's just a matter of having to think about things you might not have have thought about before, and the calculation of risk always makes risk feel apparent. Every time I step on the gas at a green light, there's the risk of someone running the red and killing me. Every time I get on the subway, there's the risk of a bomb going off. (God, now I'm going to turn myself into a shut-in.)
So don't be afraid. Just be aware. I am an intrepid eater, a lover of dingy dives and a fan of restaurants whose sanitary conditions would scare off many non-human animals. But you don't have to be, and you should be able to make your own choices (and handle your own food) with the same knowledge that professional cooks are supposed to know.