Most gastroenterologists require patients to fast for 6–8 hours before an upper endoscopy (examining the esophagus, stomach, and small intestine). For a colonoscopy (examining the colon), the fasting period is typically 8–12 hours, though specific requirements depend on the procedure type and time of day. Your doctor will provide precise fasting instructions, usually in writing a few days before your appointment. Generally, you should stop eating solid foods at midnight if your procedure is scheduled for the morning. Clear liquids like water, broth, black coffee, or tea without milk may be allowed until 2–4 hours before the procedure, but confirm this with your medical team. The fasting requirement exists to keep your stomach empty, which allows the doctor to see clearly inside your digestive tract and reduces the risk of aspiration if sedation is used. Some medications may need to be adjusted or paused before the procedure—your doctor will advise which ones. If you accidentally eat or drink when you shouldn't have, notify your doctor immediately; they may need to reschedule to ensure your safety and the procedure's effectiveness. Always follow the specific instructions provided by your healthcare facility, as preparation requirements can vary slightly between institutions and based on your individual health situation.