A father asked his son to plug in the platta where the food for Shabbos day was being kept. The son before Shabbos forgot to plug it in however remembered later Friday night when the food had already cooled down. He then plugged in the platta. Later he told his Father what had happened may the food be eaten?
Because plugging in the hotplate involves a Torah prohibition (the filament in the hotplate), the food cannot be eaten hot, and can only be eaten after it cools. See Shulchan Aruch and Mishnah Berurah 318:1. However, if the melachah was done be-shogeg (the didn’t realize it was so late), there is room for leniency (Mishnah Berurah 7).
Concerning a child under bar-mitzvah, see Biur Halachah 325:10.