Assigning oxidation numbers to atoms in a compound or reaction helps to determine which atoms gain or lose electrons.