Peptic ulcer disease is common, affecting 1 out of 12 people in the United States. Approximately 1 in 5 peptic ulcers is associated with Helicobacter pylori infection, with most of the rest due to nonsteroidal anti-inflammatory drug (NSAID) use. The combination of H. pylori infection and NSAID use synergistically increases the risk of bleeding ulcers more than sixfold. The H. pylori test-and-treat strategy is the mainstay of outpatient management. Patients younger than 60 years who have dyspepsia without alarm symptoms should be tested and, if positive, treated to eradicate the infection. If negative, they should be treated empirically with a proton pump inhibitor (PPI). Esophagogastroduodenoscopy is recommended for patients 60 years and older with new symptoms and for anyone with alarm symptoms. Noninvasive testing for H. pylori using a urea breath test or stool antigen test is preferred. Bismuth quadruple therapy or concomitant therapy (nonbismuth quadruple therapy) is the preferred first-line treatment for eradication because of increasing clarithromycin resistance. To lower the risk of ulcers associated with long-term NSAID use, clinicians should consider coadministering a PPI or substituting an NSAID with less effect on gastric mucosa, such as celecoxib. Eradicating H. pylori in NSAID users reduces the likelihood of peptic ulcers by one-half. Potential risks of long-term PPI use include fractures, interaction with antiplatelet medications, chronic kidney disease, Clostridioides difficile infection, dementia, and magnesium, calcium, and vitamin B12 micronutrient deficiencies.