Endoscopy is a procedure used to view and operate on internal organs, with various types including arthroscopy, colonoscopy, and bronchoscopy. It serves both diagnostic and therapeutic purposes for conditions such as tumors and inflammatory bowel disease, utilizing techniques like capsule endoscopy and endoscopic ultrasound. The procedure typically lasts 30-60 minutes, requires fasting beforehand, and involves recovery time post-procedure.