I have had a cough for 3 months and it was so bad two weeks ago my long collapsed and I was in the hospital, I am 65 and very healthy otherwise.?

Be seen. You need to see a pulmonologist. It is possible it is due to a more serious problem such as a cancer in the breathing tubes, an atypical infection such as pertussis, or other causes.
Diagnosis? You need to be evaluated by your doctor to find out the etiology of the cough so that it can be treated and at least controlled, if not eliminated. There are many possible diagnoses including reflux, bronchospasm, post-nasal drip, bronchitis, etc. If you are smoking, you need to stop and your doctor can also help with that, too. Good luck to you!