The car is overheating and the heater doesn't work Is there a connection?

Yes. Your thermostat has gone bad, not allowing the water to flow freely through the radiator. They are generally very simple to replace. Your local auto parts will help most often.

The connection is that both functions (keeping your engine at the proper operating temperature and providing a source of heat to the passenger compartment of your car) rely on the flow of "radiator fluid" through your engine.

First a basic description of the system. A thermostat located on the top of your engine has a hose just about big enough to get your hand around it connected to it's housing. The thermostat normally stays closed until the engine radiator fluid temperature gets to 165 to 190 degrees (half to 3/4's on a temp gauge on your instrument panel). It then opens to allow flow. Radiator fluid flows from the thermostat through a hose just big enough to get your hand around to top of the large radiator at the front of the engine compartment. The fluid flows through the radiator and ram air from driving or fans mounted on the radiator cool the fluid before it flows out of the other side on the bottom (same diameter hose) to the water pump mounted on the engine. When the fluid gets hot it expands. As small diameter hose from the radiator cap filler neck allows it to escape to a plastic overflow reservoir in your engine compartment. From the water pump, most of the fluid flows back to the engine to collect heat again but a portion of it flows to the heater core (a small radiator) typically located in the passenger compartment behind the dash. Air from a blower is heated as it blows through the heater core and into the passenger compartment.

The troubleshoot: What can restrict proper flow? Low fluid level (internal or external leak, air in system, evaporation over a very longer period of time), thermostat stuck closed, water pump failed or clogged internal passages.

Note: Always take safety seriously. Engine belts and fans grab loose clothing or hair. The cooling system has extremely hot poisonous fluid under pressure [gloves, splash goggles, proper disposal].

With a cold engine, check the reservoir level. It should have a cold level line. Service to line. Remove the radiator cap and check the level. If low, service, replace the cap, start the engine and look for external leaks and if dry see check if you have heater function and cool engine. Keep an eye on the level over the next couple days. If it goes down, get to a qualified mechanic to check for exhaust gas in the fluid (head gasket). If it's full, try squeezing the upper and lower hoses quickly and look for bubbles in the cap filler neck followed by a drop in the fluid level. This is air in the system that could slow or restrict flow or proper temperature sensing. Service and repeat until the level stays full. Many engines have bleed taps just downstream of the water pump and thermostat (looks like a small hex head bolt screwed into a slightly larger hex head bolt). With engine running and the smaller hex turned no more than a 1/2 turn counter clockwise, a steady flow of fluid should drain from it when the system is air free. If you can't get this it may take a qualified mechanic to thoroughly bleed the system.

To check for a stuck closed thermostat, feel the upper and lower radiator hoses when the engine temperature gauge is between 1/2 and 3/4. Be very careful, both should be getting hot. To be sure about the thermostat function, it can be removed and checked in a pot of water on the stove, actuating open just before boil.

If the fluid level is good, you know the thermostat works and the system is air free, flow could be restricted by blockage. Again I'd recommend a qualified mechanic to do a system flush and/or radiator replacement.

Water pumps usually leak a great deal out a weep hole on the bottom when they fail which is pretty much a mister obvious before you do all the above.