The object in balancing an equation is to make sure that you have the same number of each type of atom on both sides of the equation. Once you have written the correct formulas for the reactants and products you need to adjust the coefficients (the numbers that go in front of the formulas) to make sure that you have the same number of atoms on both sides.
In your example:
You need to have the same number of oxygen atoms on both the product and reactant side. Since you are starting with 3 O atoms on the reactant side and 2 O atoms on the product side, if we put a 2 in front of the formula containing 3 O atoms and a 3 in front of the formula containing 2 O atoms on the product side, we will have 6 O atoms on both sides and balanced for the O
2 NaClO3 --> NaCl + 3 O2
Although the equation is now balanced for oxygen atoms (6 O atoms on both sides), it is not balanced for either Na or Cl. As it stands there are 2 Na atoms and 2 Cl atoms on the reactant side and only 1 Na and 1 Cl on the product side.
This can be remedied by putting a 2 in front of the NaCl on the product side.
2 NaClO3 --> 2 NaCl + 3 O2
Now there are the same number of each type of atom on both the reactant side and the product side and the equation is balanced.
It is necessary to balance equations because atoms can neither be created or destroyed in chemical reactions. All of the atoms that you start with as reactants MUST be present among the products.