You must make sure all the elements on both sides are equal in number. This involves simple mathematical calculation of multiplication. Let's look at this example :
1. Potassium reacts with hydrochloric acid, produces potassium chloride and hydrogen gas.
K + HCl ----> KCl + H₂
~ You have 1 each for K and Cl on the left and right side. However on the right side, there are 2 H, but 1 on the left side. Therefore, you need to add "2" for HCl.
K + 2HCl ----> KCl + H₂
~ The number of H is now balanced. But Cl is not. You have to add "2" to KCl. And when you do that, you need to add "2" to K as well so that the number for K is also balanced.
2K + 2HCl ----> 2KCl + H₂
* The above equation is balanced.