To balance chemical equations, what must be done is the same number of each element in the input must be present in the output. For example, photosynthesis.
H2O + CO2 —> C6H12O6 + O2
As can be deduced, the input only has 2 H, 1 C, and 3 O. Whereas, the output has 6 C, 12H, and 6 O. When balancing I recommend to balance the unique elements if possible (for example, H is only in one molecule on each side)
So you get 6(H2O) + 6(CO2) —> C6H12O6 + 6(O2)
Hope this helped!