The following statement is true:
Oxygen atoms always have a -2 oxidation state, unless it is in the elemental form O2 when it is 0, or in a peroxide such as H2O2 when it is -1.
This means that in most compounds containing oxygen, the oxygen atom will have an oxidation state of -2, unless it is in its elemental form (O2), in which case its oxidation state is 0. However, in peroxides such as H2O2, each oxygen atom has an oxidation state of -1.