The air conditioning problem might be due to a slipping belt as suggested above, or it could be a faulty AC pump clutch. These are usually electrically operated, and a bad switch, thermostat, or connector could make it cut in and out randomly. It could also be a blocked evaporator/condensor or condensor fan fault, making the system overheat and operate inefficiently. Another possibility is that the refrigerant is low or has a leak, which would make the system work more and more ineffectively until it stops completely.
The clicking noise could be a valve fault, lifters, rockers, or whatever, or valve guide wear. Does it change speed with the engine revs?
It just might be related to the AC fault, thinking about it. Possibly the pump clutch is slipping and that's where the clicking is coming from?
pca
_________________________
Experience is what you get just after it would have helped...