the car immediately overheats and the fan motor doesn’t turn. thr A/C hasn’t worked for years, so I don’t think it is involved with the current problem.
If the cooling fan doesn’t’ work, the car will overheat. Replace it.
If the fan won’t turn you probably need a new fan motor. If the fan can still be turned by hand the problem may be in the electrical system. The radiator temp sensor could be bad, or the fan relay, or the wiring.
Someone will have to troubleshoot the components to figure out which one is faulty.
Don’t drive the car if it’s overheating. The engine could be severely damaged.
Or it could be a stuck thermostat. If the thermostat is stuck and not allowing coolant to get from the engine to the radiator, the coolant in the engine will be overheating but the coolant in the radiator will be fine and the fan won’t turn on.