Endoscopy is commonly used to diagnose and treat conditions such as gastrointestinal disorders, such as ulcers, inflammation, and bleeding, as well as cancers of the digestive tract. It can also be used to diagnose and treat respiratory, urinary, and gynecological disorders.