If you are going for an endoscopy then you have to keep your stomach empty. In other words, you have to keep your stomach empty for 8 hours before endoscopy. However, you can drink water 4 hours before the process of endoscopy. But, don’t eat anything if you are going to diagnose digestive problems through endoscopy.