Generic Prilosec is used for treating heartburn or irritation of the esophagus caused by gastroesophageal reflux disease (GERD). It may also be used for short-term treatment of ulcers of the stomach or small intestines and to help prevent them from coming back; to treat conditions that cause your body to make too much stomach acid (eg, Zollinger-Ellison syndrome).