What is the oxidation state of aluminium in NaAlO₂? I guess that sodium loses an electron so has an oxidation state of +1 and that oxygen has an oxidation state of −2. But what oxidation state does the aluminium atom have in sodium aluminate ($\ce{NaAlO2}$)?
For every compound the sum of the oxidation states of the constituent atoms must be equal to the charge of the compound. So, since your compound is neutral the individual oxidation states have to add up to $0$. And as you have already determined the oxidation states of 2 atoms in the system the last one must be $+3$, since $1 + 3 - 2 \cdot 2 = 0$.