When stomach pain is accompanied by the presence of undigested food in the stool, indigestion may be caused by dietary factors, gastrointestinal dysfunction, inflammation of the gastrointestinal tract, and other factors. It can be treated with dietary adjustments and medication according to the cause. 1. Dietary factors: If you eat hard-to-digest food such as barbecue or overeat, it is easy to irritate the gastric mucosa and cause stomach pain and indigestion, leading to abnormal stools. At this time, you need to change the incorrect eating habits, light diet. 2. Gastrointestinal dysfunction: if the patient’s intestinal flora imbalance, decreased digestive ability, may cause food indigestion, resulting in stomach pain, stool abnormalities. At this time, you can take gastric mucosa protector such as aluminum sulfate to reduce stomach pain, and take probiotics such as bifidobacteria to improve stool abnormalities. 3. Inflammation of gastrointestinal tract: If the patient is infected by microorganisms such as Helicobacter pylori, it is easy to stimulate the mucous membrane of gastrointestinal tract, triggering inflammation and pain, at this time, you can use the quadruple method, i.e., one kind of proton pump inhibitor such as omeprazole + one kind of bismuth such as colloidal bismuth + two kinds of antibiotics such as amoxicillin and clarithromycin to carry out eradication treatment. When patients have stomach pain as well as abnormal stool patterns, they need to seek medical attention in time to clarify the cause of the disease, and use medication or other means of treatment under the guidance of the doctor to avoid unauthorized use of medication and to prevent the triggering of adverse consequences.