Different atoms within compounds are held together by the sharing of electrons. Oxidation states are a way of keeping track of the electrons in a compound. Because electrons have a negative charge, atoms which have "taken" electrons from other atoms have negative oxidation states, and the atoms which lose them are positive. Oxidation numbers assume completely ionic bonding. In reality, electrons are not always lost and gained but rather shared. The actual charges of atoms may be different. Oxidation-reduction reactions involve a change in oxidation numbers of individual atoms, but the sum of the oxidation states within a neutral molecule -- one this is neither a cation or anion -- is always zero.
Count the number of hydrogens. CH4, or methane, has four hydrogens. Whenever you are trying to find oxidation states, always start with hydrogen and oxygen. Hydrogen always has an oxidation state of +1, unless it is bound directly to a metal, such as in NaH or LiH, in which case it has an oxidation state of -1. Oxygen always has an oxidation state of -2, except in peroxides such as H2O2, where its oxidation state is -1.
Multiply the number of hydrogens by +1. In the case of methane, this gives us a result of +4.
Give the carbon atom an oxidation state such that the sum of all the oxidation states is zero. In this case, that means that carbon has an oxidation state of -4. Carbon is versatile in this sense -- it can have oxidation states of +4, +3, +2, +1, 0, -1, -2, -3, or -4. In summary, each hydrogen has an oxidation number of +1, while the carbon has an oxidation number of -4.