Sometimes the check engine light will come on
and when it does there is no heat. When light is not
on there is heat
First of all check the coolant level cold and refill if it is low, then find out what code is stored in the system, the light has came on so there should be some, then repost back here and someone will jump in and help you along with further diagnosis.