A biopsy may be performed during an endoscopy. A biopsy is a removal of cells or tissue for examination by a pathologist. A pathologist will examine the tissue under a microscope to look for cancer cells. A biopsy is the only sure way to know if cancer cells are present.