To find the oxidation number, one has to use the oxidation number rules. One of the rules is that oxygen has an oxidation number of -2 in most compounds. Alkali metals always have an oxidation number of +1 in their compounds and alkaline earth metals always have an oxidation number of +2. In a neutral compound, the sum of the oxidation numbers of all atoms must be zero. In a polyatomic ion, the sum of the oxidation numbers must equal the charge of the ion. As an example, for sulfur dioxide (SO₂), assign oxidation numbers based on the rule that oxygen generally has an oxidation number of -2. Thus since there are 2 oxygens, it would give a sum of -4, and since the sum of the oxidation numbers of all atoms must be zero (for neutral compounds like this), the oxidation number is 4.