If H. pylori caused the ulcers, antibiotics are taken to kill the germ. If NSAIDs caused the ulcers, a health care provider will decide the best treatment.