This pilot clinical trial studies how well bronchoscopy with bronchoalveolar lavage works in identifying biomarkers of response to immune checkpoint inhibitors in patients with non-small cell or small cell lung cancer. Bronchoscopy uses a thin, tube-like instrument inserted through the nose or mouth to view the inside of the trachea, air passages, and lungs. Bronchoalveolar lavage washes out the bronchi and alveoli by flushing with a fluid. Bronchoscopy with bronchoalveolar lavage may make it easier to help determine biomarkers that are more present in some cancers than others that will help determine which individuals have a greater or lesser chance of benefiting from immunotherapy.