Chemical reactions typically proceed via stochastic encounters between reactants. Going beyond this paradigm, we combined exactly two atoms in a single, controlled reaction. The experimental apparatus traps two individual laser-cooled atoms [one sodium (Na) and one cesium (Cs)] in separate optical tweezers and then merges them into one optical dipole trap. Subsequently, photoassociation forms an excited-state NaCs molecule. The discovery of previously unseen resonances near the molecular dissociation threshold and measurement of collision rates are enabled by the tightly trapped ultracold sample of atoms. As laser-cooling and trapping capabilities are extended to more elements, the technique will enable the study of more diverse, and eventually more complex, molecules in an isolated environment, as well as synthesis of designer molecules for qubits.