Cooking food makes it easier to eat and digest by softening tissues and starch. Cooking thoroughly kills bacteria by heating them, so rare or undercooked foods can still contain harmful bacteria. To be safe, thoroughly cook foods until bacteria are killed to avoid potential food poisoning.