Few meals are prepared and then eaten in their entirety. This is especially true for holiday meals or other special occasions. Leftovers are to be expected, and in many cases leftovers are eagerly awaited. Sometimes leftovers can be even more delicious than when the meal was originally served.

Storing leftovers may not be that easy as poorly stored food can lead to illness when consumed later. Learn the basics of leftovers and how to extend the shelf life of leftover food.

Food poisoning, also known as food poisoning, is caused by harmful bacteria that grow in food. Few people can detect changes in the taste or texture of contaminated food, so knowing if a food is dangerous to eat can be difficult, says The Mayo Clinic. Bacteria grow well in the so-called “danger zone”. This is between 40 F and 140 F.

Many cases of foodborne illness can be prevented with proper food handling, which begins with the purchase of food and continues throughout the cooking process, culminating in the safe storage of leftovers. The US Department of Agriculture’s Food Safety and Inspection Service recommends refrigerating leftovers within two hours of cooking or keeping them warm. Any food left for more than two hours should be discarded if perishable.

The Mayo Clinic advises that most leftovers can be stored in the refrigerator for three to four days. If not eaten during this period, it is best to freeze the food for later use. Some foods can be frozen for three to four months.

To cool food quickly and prevent bacterial growth, separate food into small, shallow containers. Cut large foods into smaller portions to cool. Don’t let food cool on the counter before storing it in the refrigerator.

Thawing leftovers is another potential safety concern. Use a cold water bath, the refrigerator, or the microwave to thaw frozen leftovers. Chilled food can simply be reheated.

When reheating leftovers, make sure they reach 165 F. Sauces, soups and sauces should be brought to a boil. The USDA also recommends covering leftovers to reheat them. This retains moisture and ensures the food is fully warmed through. When preparing food in the microwave, check the food for cold spots and reheat accordingly.

Handling leftovers safely can help prevent illness and ensure leftovers are not wasted.