YOU deserve some type of response, even if it doesn't fix your Issue, my 2 cents >>>>
I'd say there are THREE possibilities >>> (maybe even more)
#1 Bad Fan Switch, sometimes contact cleaner will resolve the issue.
#2 Bad / Loose / Dirty connections at the Switch or the Motor, clean a tighten.
#3 Worn Out / tired Fan Motor, Motor windings getting hot and shutting the motor
down, in which case the Motor needs replacement.
FINALLY ----- DON'T skip looking at the obvious, ------ what ever that could be.
If it's obvious, check it ANYWAYS ! Often times the skipped or overlooked,
IN ANYTHING, is the cause of the BIGGEST HEADACHES. DO NOT OVERLOOK checking GROUNDS !!!!
When it come to Electrical, there are a lot of possibilities that can give the same results / symptoms to a variety of issues. Trouble shooting Electrical issues is a science with NO RHYME OR REASON to a lay person, or even to the most knowledgeable, IN SOME CASES. Seems to be a world of its own at times.
(if it were easy, a lot more would be doing it.)