If taking food away from home--on a picnic, for example--try to plan just the right amount of perishable foods to take. That way, you won't have to worry about the storage or safety of leftovers.
Items which don't require refrigeration include fruits, vegetables, hard cheese, canned meat or fish, chips, bread, crackers, peanut butter, jelly, mustard, and pickles. You don't need to pack them in a cooler.
After estimating the amount of food which needs to be kept cold, pack an insulated cooler with sufficient ice or gel packs to keep the food at 40 F. Pack food right from the refrigerator or freezer into it.
Why? Bacteria grow and multiply rapidly in the danger zone between 40 F and 140 F (out of the refrigerator or before food begins to cook). So, food transported without an ice source or left out in the sun at a picnic won't stay safe long.
If packing a bag lunch or lunch box, it's fine to prepare the food the night before and store the packed lunch in the refrigerator.
To keep the lunch cool away from home, pack a small frozen gel pack or frozen juice box. Of course, if there's a refrigerator at work, store perishable items there upon arrival. Leftover perishables which have been kept refrigerated should be safe to take home. But once gel packs and other cold sources melt, perishables are not safe -- discard them.
When taking food to a picnic, don't put the cooler in the trunk; carry it inside the air-conditioned car. At the picnic, keep the cooler in the shade. Keep the lid closed and avoid repeated openings. Replenish the ice if it melts.