An endoscope is a flexible tube used to examine internal body cavities. It contains lenses, a light source, and channels to provide illumination, collect images, flush areas with water, and insert surgical tools. Physicians use endoscopy to diagnose medical problems by visually inspecting organs and tissues, collect tissue samples, and perform minimally invasive surgeries. Different types of endoscopy are named based on the body part examined, such as laryngoscopy for the vocal cords or gastroscopy for the stomach.