Some of the atoms are easy. All of the oxygens in compound have an oxidation state of minus two. All of the hydrogens have an oxidation state of plus one. Potassium is a group one element, so it should have an oxidation state of plus one in the compounds. That seems to make sense because dichromate and chromate ions have a charge of minus two and there are two potassium atoms in each compound.
Hydroxide ion has a charge of minus one and it has one potassium.
We can do a little primitive math on the material either from the starting point of the compound or the ion to find the oxidation state of chromium in that compound. The entire compound must have a net oxidation state of zero, so the oxidation numbers of two potassiums one chromium and four oxygens must equal to zero. We know the oxidation state of everything else but the chromium. Or we could do it from the point of view of the chromate ion. The oxygens are minus two each.