Hyundai Elantra heating/air turning on and off

I have to assume that what is turning on and off is actually the blower fan? So you hear a click and the fan stops blowing air out? Or are you saying that the fan keeps blowing air but it stops blowing warm/cold (whichever) air?

Assuming that the fan just stops blowing but the actual temp of the air doesn’t change then you have an issue with the blower motor circuit. It starts at the switch on the dash, goes to a resistor, and then to the fan. Somewhere the circuit will involve a fuse and maybe a relay. Hyundai’s design might also involve other things I don’t know about.

So someone has to check out your blower motor circuit. You can at least stick your head up under the glove box and find the main power connector for the blower and inspect it. Pull it off, clean it with some electronics cleaner, look for obvious damage and make sure it connects tightly. But your issue may be elsewhere.