You break down the compound into ions.
Your compound is called potassium ferrocyanide, and is actually an ionic compound formed when potassium cations,
So, you know that your compound is neutral, so that means that the total charge of the cations must balance the total charge of the anion.
The oxidation states of all the atoms that are part of the compound must add up to give zero.
Since you're dealing with a group 1 element, potassium's oxidation number can only be +1. Now take a look at the anion.
Notice that it contains the cyanide polyatomic ion,
Since you have 6 cyanide ions, this equation becomes
So iron has a +2 oxidation state in the compound.
The oxidation states of carbon and nitrogen in the cyanide ion can be found by taking into account the fact that nitrogen is more electronegative than carbon and that it only needs three electrons to complete its octet.
This implies that nitrogen will have an oxidation state of -3, which leaves carbon with an oxidation state of
Therefore, the oxidation states of all the atoms that are a part of the compound will be