here goes an example:
You have a 0.1M solution of phosphoric acid.
Mass balance (sum of all forms of acid present equals its initial concentration):
[H3PO4] + [H2PO4-] + [HPO42-] + [PO43-] = 0.1
Charge balance (solution is neutral):
[H2PO4-] + 2[HPO42-] + 3[PO43-] + [OH-] = [H+]
If you have solids present you may need to express mass balance in terms of not concentrations, but numbers of moles.