Thermostat or...

In the Summer the AC compressor wouldn’t shut off and it iced up, would do fine if you switched it to fan and only let the AC compressor run for 10 or 15 minutes, then turn it to fan only…now when I want heat from it the heater will not come on, fan blows…just no heat. Is this the thermostat or something else tricky?
Thanks a bunch!!
PeggySue