Endoscopy in neonates is typically performed under general anesthesia to ensure the infant remains still and comfortable. The procedure involves inserting the endoscope through a natural opening (such as the mouth or anus) or a small incision, depending on the type of endoscopy being conducted.