To best represent the conservation of matter in a chemical reaction, the image you mention (4 black dots and 8 yellow dots) should correspond to the products of the reaction, maintaining the same number of atoms of each type as in the reactants.
If the reactants consist of a certain number of black dots and yellow dots combined with an appropriate stoichiometry, then the products (the image you mentioned) should have an equal number of those same dots. This ensures that the total number of atoms before and after the reaction remains the same, illustrating the conservation of matter principle.
For example, if the reactants are represented by a certain combination of black and yellow dots (let's say, for instance, 4 black and 8 yellow as you describe), the products should also have 4 black dots and 8 yellow dots.
If you have specific reactants in the diagram, please provide those details, and I could give you a more tailored response.