More than likely it's the heater control valve (if your Jeep still has one). They are usually vacuum controlled and, you know as well as I do, YJ's are notorious for vacuum problems. The extreme hot and cold makes the plastic vacuum lines brittle and they break real easy. And sometimes the diaphragm inside the HCV goes bad.
You may also want to check your thermostat.