ERCP is a specialized endoscopic procedure to diagnose and treat bile ducts, pancreas, and gallbladder conditions. It involves passing an endoscope through the mouth, esophagus, stomach, and duodenum. A dye is then injected into the bile and pancreatic ducts, allowing X-ray visualization of these structures. ERCP can remove gallstones, open narrowed bile ducts, or place stents to relieve obstructions.