Endoscopic retrograde cholangiopancreatography (ERCP) is the most technically demanding and risky gastrointestinal endoscopic operation, which is called the crown jewel of endoscopy. It has the advantages of no incision, less trauma, shorter operation time and shorter hospital stay, which will greatly facilitate patients’ access to medical treatment. While confirming the diagnosis, doctors can complete complex surgeries such as removing gallstones, placing stents, cutting tumors and unblocking bile ducts without opening the abdomen and using only a few millimeters thick endoscope, which has replaced to some extent the traditional surgeries for some digestive system diseases. Indications: (1) Bile duct stones: after removing bile duct stones under duodenal endoscopy, it can replace traditional dissection bile duct extraction and T-tube drainage without opening the abdomen and with little trauma. (2) Residual bile duct stones after cholecystectomy: stones can be removed endoscopically to avoid the pain of reoperation. (3) Acute biliary-derived severe pancreatitis: endoscopic nasobiliary drainage in 1-3 days in the early stage can improve the success rate of treatment. (4) Septic cholangitis: high mortality rate and high risk of traditional surgery, timely endoscopic biliary drainage for decompression can rapidly stabilize the patient’s condition and gain valuable time for surgical treatment. (5) Duodenal papillary cancer: early diagnosis is difficult, ERCP is clear at a glance and biopsy is possible. (6) Chronic pancreatitis and pancreatic duct stones. (7) Obstructive jaundice caused by bile duct cancer or pancreatic head cancer: stenting is feasible to resolve jaundice, delay liver failure and greatly prolong survival. Common complications: Since ERCP is an invasive and minimally invasive technique, it will inevitably bring certain complications, and even serious complications can be life-threatening. The incidence of ERCP-related duodenal perforation is low, but the mortality rate is very high, especially in the vicinity of the duodenal papilla. Both doctors and patients must be fully aware of the indications before surgery. The main diagnostic bases for perforation are: peritonitis and subcutaneous emphysema. Some minor perforations that can be detected early can be treated conservatively under endoscopy: endoscopic placement of an internal drainage tube and/or nasobiliary drainage, clamping of the perforation with titanium clamps, fasting with intravenous nutrition and antibiotics, and surgery in severe cases. Hemorrhage: ERCP lithotomy requires incision of the duodenal papilla, and this operation often causes bleeding. Injurious bleeding can also occur with pancreaticobiliary duct dilation and stent placement. In general, hemorrhage can be stopped endoscopically. For active hemorrhage that cannot be controlled by endoscopy, surgical hemostasis should be performed promptly. Infection: ERCP surgery has a small invasive surface and the incision is mucosal, which is highly resistant to infection, so local infection caused by ERCP surgery incision is rare. However, after ERCP placement of biliary stent for biliary obstruction, stent blockage can cause biliary infection. In addition, contrast agents can also introduce bacteria and cause pancreaticobiliary duct infections. In case of infection, postoperative antibiotic therapy should be used prophylactically. If the pancreaticobiliary duct infection is severe, timely drainage of the stent is required, and ERCP or surgical removal of the stent is required again, but the risk of surgery is increased. Other complications: including intestinal obstruction, antibiotic-related diarrhea, liver abscess formation, pneumothorax/mediastinal pneumatosis, colonic diverticulum perforation, duodenal hematoma, portal vein pneumothorax, etc. should be noted during clinical operation.