A colonoscopy is a diagnostic procedure that allows a doctor to examine the inner lining of your large intestine (colon) and rectum. Using a long, flexible tube equipped with a camera (colonoscope), the doctor can detect abnormalities or changes, such as inflamed tissue, ulcers, and polyps.