Diagnosing the cause of hemoptysis involves a thorough medical history, physical examination, and various diagnostic tests. Imaging studies like chest X-rays and CT scans are essential for identifying lesions in the lung. Bronchoscopy can provide a direct view of the airways and allow for biopsy if needed. Sputum cytology and blood tests may also be conducted to identify malignant cells or other abnormalities.