You can often treat stomach ulcers with medications that decrease stomach acid and kill H. pylori bacteria. Lifestyle changes like avoiding certain foods, relieving stress, and avoiding smoking can ...