During an ileostomy, a surgeon removes the colon (large intestine) and part of the last section of the ileum (small intestine) if they are diseased.