Chemical equations can be written down in 3 steps:
As example I’ll using the rusting of iron (as given)
1) Write down the products that react on the left side of the arrow.
2) Write the products after the reaction on the right side of the arrow. If there are one or more of a different atom that isn’t on the other side of the equation, the reaction is missing something on either sides.
Fe -> Fe2O3
But as you can see there are no O on the left side. The right formula is:
Fe + O2 -> Fe2O3
Review to make sure you wrote down everything.
3) Count all the atoms of each elements on each side. Balance out the amount of atoms on both sides by adding coefficients to your compounds
Take note that you need to multiply all the elements in the compound times the number
Fe + O2 -> Fe2O3
We need at least 2 iron atoms to balance out on the iron.
2Fe + O2 -> Fe2O3
Now we see that we have 2 O atoms on the left and 3 on the right. The smallest number that is divisable by both 2 and 3 is 6. Add coefficients in front of O2 and Fe2O3.
2Fe + 3O2 -> 2Fe2O3
Now we see that on the right there are 4 iron atoms. Balance out by multiplying iron on the left by 2.
4Fe + 3O2 -> 2Fe2O3
This is the final equation.