Two practical points make a real difference to how safely leftover food holds up in storage, beyond simply putting it away.
1. Store in shallow containers rather than one large, deep one: Spreading leftovers into shallow, wide containers instead of piling everything into a single deep pot allows the food to cool down evenly and quickly once refrigerated. A large mass of food cools very slowly from the outside in, leaving the centre in the temperature range where bacteria multiply fastest for far too long.
2. Reheat thoroughly and only once: When leftovers are eaten again, they should be reheated until steaming hot all the way through, not just warmed on the surface, to kill off any bacteria that may have grown during storage. Leftovers should also only be reheated a single time; repeatedly cooling and reheating the same portion increases the chances of bacterial growth with each cycle.
Therefore, when storing leftover food, it helps to use shallow containers so the food cools quickly and evenly, and to reheat it thoroughly, and only once, before eating it again.