* Identify the elements: You have carbon (C), hydrogen (H), oxygen (O), and nitrogen (N).
* Count the atoms: You have 8 carbon, 10 hydrogen, 2 oxygen, and 4 nitrogen atoms.
* Write the formula: The chemical formula for caffeine is C8H10N4O2.