Breath tests work by detecting specific gases or isotopes in the breath that are indicative of particular metabolic processes or infections. For example, increased hydrogen in the breath may indicate carbohydrate malabsorption, while labeled carbon dioxide may suggest the presence of *H. pylori*.