Most likely neither your thermostat or temp sensor are bad. Most of the time it will be battery, alternator or ecu. Try removing your negative cable for 30secs then reconnecting. Power surges can cause the ecu to become confused and lock out the temp sensor and kick one the fan to prevent the engine from overheating. Removing the neg cable allows the ecu to reset. I’m no mechanic but it has been the case with my 2014 Chevy PU. I’d say it’s time to replace battery and see if that fixes your issue