Heater not working reliably, is it caused by a bad thermostat?

During winter last year, upstate NY… like 10 degrees outside, drive to work…NO HEAT… 20 minute ride and i warmed car up for 10 minutes before i left for work. no heat… other cold days, will be driving and heat on and NO HEAT, then in an instance HEAT… i figure thermostat bad…opening inconsistently. sound like the issue?
two days ago, had 37 degrees here in NY state…drove to work…NO HEAT…just blowing cold air. Driving home later, got heat.
thanks tom

My car has 88000 miles.
My car has an automatic transmission.

– Heater not working reliably, is it caused by a bad thermostat?