If an H. pylori infection caused your peptic ulcer, your health care provider may prescribe antibiotics. Antibiotics are medicines used to treat bacterial infections.