Surgery can be done to both diagnose and treat lung cancer. In most cases, surgery is used if the cancer is found in an early stage. You will need to prepare. Work with your healthcare provider to learn more about what to expect before, during, and after surgery.