A bronchoscopy can be used to diagnose and treat diseases of the respiratory system.