Your car contains electrical components that are wired directly (relatively speaking) to the battery (e.g., headlights, courtesy lights) that have power all of the time, and components that are wired through the ignition circuit (e.g., heater motor, radio, wipers, power windows) that don't receive power unless the ignition switch is in good order and the ignition key is turned to the proper position. If the electrical contacts inside the ignition switch are worn, electrical current will flow in an intermittent manner, or not at all, even if the key is in the proper position.
Try this: Next time the heater motor won't work, turn the heater motor switch to a running position, start the car and move the ignition key around (very slightly when turning it forward, to prevent accidential engagement of the starter), push it in, etc. Generally, manipulate the key in small increments in every possible direction. See if the heater motor comes on, even briefly. If it does, the ignition switch is the culprit and must be replaced.
These switches wear prematurely if the ignition key is attached to a heavy set of keys or keychain. The excess weight puts a mechanical strain on the switch.