A method of heating food is provided, which employs a cooker provided with a control program and a reader to identify a food package attached with a coded object which embodies the parameters associated with the food package, the parameters including temperature and time, whereby the contents of the parameters of the coded object can be read by the reader and compared by the control program so that the control program can issue commands to conduct a heating procedure according to the contents of the parameters of the coded object. Thus, the food package can be heated or cooked more easily, conveniently, safely, and economically, and the disadvantages resulted from incorrectly manual operations can be avoided.