To find the oxidation state of an element in a compound, use the standard rules: O is -2 (except in peroxides), H is +1 (except in metal hydrides), halogens are -1 (except when bonded to a more electronegative element). The sum of oxidation states must equal the overall charge of the molecule or ion.