Eligibility Criteria:
Inclusion Criteria:
* Documented informed consent of the participant and/or legally authorized representative. (Adult patients lacking capacity to consent may participate if they have a caretaker that could ensure compliance.)
* Participants must have either A) HopeSeq or Tempus molecular testing results reported within 3 months prior to enrollment or currently in process OR B) archival or new biopsy tissue available (to be sent to Tempus). Acceptable sample types include: two formalin-fixed paraffin-embedded (FFPE) tissue core biopsies, or two 25um sections of 5-10mm\^2 tissue, or 15-20 unstained slides at 10um thickness (a minimum of 10 unstained slides must be provided)
* Agreement to blood collection for ctDNA research
* Age: ≥ 18 years
* Eastern Cooperative Oncology Group (ECOG) ≤ 2
* Histologically confirmed stage IIIB or IV NSCLC
* Absence of sensitizing EGFR mutation or ALK/ROS1 alteration
* Scheduled to begin treatment with a Food and Drug Administration (FDA) approved PD1/PDL1 antibody with or without chemotherapy. Participants who have already started treatment with anti-PD1/PDL1 in this setting may enroll if they have only received up to 4 cycles of treatment so far. Patients who have received PD1/PDL1 antibody for early-stage NSCLC are allowed to enroll if they completed the therapy at least 6 months before starting trial therapy
* Measurable disease by RECIST version (v) 1.1
* Absolute neutrophil count (ANC) ≥ 1,500/mm\^3
* NOTE: Growth factor is not permitted within 14 days of ANC assessment
* Platelets ≥ 100,000/mm\^3
* NOTE: Platelet transfusions are not permitted within 14 days of platelet assessment
* Hemoglobin ≥ 9g/dL
* NOTE: Red blood cell transfusions are not permitted within 14 days of hemoglobin assessment
* Total bilirubin ≤ 1.5 x upper limit of normal (ULN)
* Aspartate aminotransferase (AST) ≤ 3.0 x ULN (5 x ULN allowed if liver metastases)
* Alanine aminotransferase (ALT) ≤ 3.0 x ULN (5 x ULN allowed if liver metastases)
* Creatinine clearance of ≥ 50 mL/min per the Cockcroft-Gault formula
* If seropositive for HIV, hepatitis C virus (HCV), or hepatitis B virus (HBV), nucleic acid quantitation must be performed. Viral load must be undetectable
* HIV-infected patients on effective anti-retroviral therapy with undetectable viral load within 6 months are eligible for this trial
* Women of childbearing potential (WOCBP): negative urine or serum pregnancy test
* If the urine test is positive or cannot be confirmed as negative, a serum pregnancy test will be required
* Agreement by females and males of childbearing potential to use an effective method of birth control or abstain from heterosexual activity for the course of the study through at least 3 months after the last dose of protocol therapy
* Childbearing potential defined as not being surgically sterilized (men and women) or have not been free from menses for \> 1 year (women only)
* PART II: Documented informed consent (for Part II) of the participant and/or legally authorized representative.
* Assent, when appropriate, will be obtained per institutional guidelines
* PART II: ECOG ≤ 2
* PART II: Fully recovered from the acute toxic effects (except alopecia) to ≤ grade 1 to prior anti-cancer therapy
* PART II: ANC ≥ 1,500/mm\^3
* NOTE: Growth factor is not permitted within 14 days of ANC assessment
* PART II: Platelets ≥ 100,000/mm\^3
* NOTE: Platelet transfusions are not permitted within 14 days of platelet assessment
* PART II: Hemoglobin ≥ 9g/dL
* NOTE: Red blood cell transfusions are not permitted within 14 days of hemoglobin assessment
* PART II: Total bilirubin ≤ 1.5 x ULN
* PART II: AST ≤ 3.0 x ULN (5 x ULN allowed if liver metastases)
* PART II: ALT ≤ 3.0 x ULN (5 x ULN allowed if liver metastases)
* PART II: Creatinine clearance of ≥ 50 mL/min per the Cockcroft-Gault formula
Exclusion Criteria:
* Surgical intervention within 4 weeks prior to study treatment, except for minor procedures such as port placement
* Patients with a condition requiring systemic treatment with corticosteroids (\> 10 mg daily prednisone equivalent) within 7 days or another immunosuppressive medication within 30 days of the first dose of study treatment. Inhaled or topical steroids, and adrenal replacement steroid doses ≤ 10 mg daily prednisone equivalent, are permitted in the absence of active autoimmune disease
* Radiation therapy within 7 days prior to day 1 of protocol therapy
* Clinically significant (i.e., active) cardiovascular disease: cerebral vascular accident/stroke or myocardial infarction within 6 months of enrollment, unstable angina, congestive heart failure (New York Heart Association \[NYHA class\] ≥ III), or serious uncontrolled cardiac arrhythmia requiring medication
* Active autoimmune disease or history of autoimmune disease that required systemic treatment within 2 years before starting treatment, i.e., with use of disease-modifying agents or immunosuppressive drugs
* Symptomatic central nervous system (CNS) metastases or leptomeningeal carcinomatosis, except for individuals who have 1) previously-treated CNS metastases, are asymptomatic, and have had no requirement for steroid medication for 1 week prior to the first dose of study drug and have completed radiation 2 weeks prior to the first dose of study drug OR 2) untreated brain metastases that are asymptomatic and stable
* Prior history of interstitial lung disease (ILD) or non-infectious pneumonitis requiring high-dose glucocorticoids
* Active infection requiring antibiotics
* Other active malignancy. Patients with concurrent malignancy other than non-melanoma skin cancer are not eligible for this trial due to potential confounding of the ctDNA results
* Females only: Pregnant or breastfeeding
* PART II: Surgical intervention within 4 weeks prior to study treatment, except for minor procedures such as port placement
* PART II: Radiation therapy within 7 days prior to day 1 of protocol therapy
* PART II ARM A ONLY: Patients with a condition requiring systemic treatment with corticosteroids (\> 10 mg daily prednisone equivalent) within 7 days or another immunosuppressive medication within 30 days of the first dose of study treatment. Inhaled or topical steroids, and adrenal replacement steroid doses ≤ 10 mg daily prednisone equivalent, are permitted in the absence of active autoimmune disease
* PART II ARM A ONLY: Patients with prior history of cytotoxic T-lymphocyte-associated antigen 4 (CTLA-4) treatment
* PART II ARM B ONLY: Patients with prior history of KRAS G12C inhibitors
* PART II: Clinically significant (i.e., active) cardiovascular disease: cerebral vascular accident/stroke or myocardial infarction within 6 months of enrollment, unstable angina, congestive heart failure (New York Heart Association class ≥ III), or serious uncontrolled cardiac arrhythmia requiring medication
* PART II ARM A ONLY: Active autoimmune disease or history of autoimmune disease that required systemic treatment within 2 years before starting treatment, i.e., with use of disease-modifying agents or immunosuppressive drugs
* PART II ARM B ONLY: Grade ≥ 2 proteinuria as demonstrated by ≥ 2+ protein and ≥ 1.0 g of protein with 24-hour urine collection (patients found to have ≥ 2+ protein on dipstick urinalysis must have 24-hour urine collection and demonstrate \< 1g of protein in 24 hours in order to be eligible for treatment)
* PART II: Clinical evidence of central nervous system (CNS) metastases or leptomeningeal carcinomatosis, except for individuals who have 1) previously-treated CNS metastases, are asymptomatic, and have had no requirement for steroid medication for 1 week prior to the first dose of study drug and have completed radiation 2 weeks prior to the first dose of study drug OR 2) untreated brain metastases that are asymptomatic and stable
* PART II: Clinically significant uncontrolled illness
* PART II: Active infection requiring antibiotics
* PART II: Other active malignancy
* PART II FEMALES ONLY: Pregnant or breastfeeding
* PART II: Any other condition that would, in the investigator's judgment, contraindicate the patient's participation in the clinical study due to safety concerns with clinical study procedures