Your doctor may recommend endoscopy to diagnose and treat a variety of diseases, disorders and conditions. A common reason to have an endoscopy is to take a tissue biopsy. A biopsy involves removing samples of tissues to examine for disease or malignancy.