During a colonoscopy or sigmoidoscopy, the doctor may do a biopsy, which involves taking a sample of tissue from the intestinal lining to look at under a microscope.