The test involves the patient ingesting a urea solution labeled with a carbon isotope, either 13C or 14C. If H. pylori is present in the stomach, the bacterial enzyme urease will break down the urea into carbon dioxide (CO2) and ammonia (NH3). The carbon isotope-labeled CO2 is then absorbed into the bloodstream, transported to the lungs, and exhaled. The patient's breath is collected and analyzed for the presence of the isotope, indicating a positive test for H. pylori.