Treating an H. pylori infection includes taking antibiotics and medications that lower the production of stomach acid in your GI tract. Treatment usually lasts for several weeks. Examples of medications that treat high stomach acidity include PPI, H2 blockers, and bismuth preparation.