Food does not last forever, even if it is stored well. Most pre-packed foods have a “use by” or “best before” date.

Some foods need to be kept chilled in the fridge to slow down the growth of harmful bacteria and keep food fresh and safe for longer. It is very important not to leave certain types of food standing at room temperature.
The packaging for these foods is usually marked with a “use by” date and “keep refrigerated” on the label, for example, milk, meat, fish and ready meals.
“Use by dates” appear on foods that go off quite quickly and show how long the food will be at its best.
Food can look and smell fine even after its “use by” date but that doesn’t mean it is safe to eat.
“Best before” dates are for foods with a longer life and show how long the food will be at its best. Eating food past its “best before” date is not dangerous, but the food may not keep its quality.
Expand the items to see how to keep food safe in relation to chilling:
You can use leftover food, if it is done safely and correctly. Cool any leftover food at room temperature, then cover it and ensure it is stored safely in the fridge or freezer within one to two hours. Splitting food into portions will help to cool it quickly. Leftovers should be eaten or frozen within two days (or one day for rice).

There are some foods that need special attention. Rice is a good example.

You can freeze rice but you can get food poisoning from eating reheated rice. It’s not the reheating that causes the problem, but the way the rice has been stored before it’s reheated.
Uncooked rice can contain spores of Bacillus Cereus which can cause food poisoning. The spores can survive when rice is cooked.
If the rice is left standing at room temperature, the spores can grow into bacteria which will multiply and produce poisons that cause vomiting or diarrhoea. The longer rice is left at room temperature, the more likely it is that the bacteria will make rice unsafe to eat.