for example the total volume is 50microliters how can we know that what will be the amount of template , buffer, enzyme, primers (forward and reverse), dNTPs, MgCl2 and water?
When you purchase a PCR kit, it usually comes with an information sheet. See attachment. The info sheet usually has a table to show how to prepare a PCR mix.
So first of all it depends on the enzyme you are using. Each enzyme will ask you for different concentrations of the components, some of them will come prepared with the enzyme, like the buffer, dNTPs and MgCl2 (if the enzyme requires it).
Before you even start to do the mix calculate how much of each component you will need to add.
You will need to prepare the primers your self, I usually dilute mine to a working concentration of 10 um and calculate how much volume I need to add.
Depending on your enzyme and your DNA preparation you might need to make calculations for how much volume of DNA solution to add. Unless I encounter problems I usually do not do this and just add 1 ul of DNA, because my DNA extraction is good enough that I always have enough DNA for my enzymes.
The last step of the calculations is to subtract from 50 ul everything you will need to add for example: 50 -(10ul buffer+4ul dNTPs+ 2ul MgCl2+2ul primers+1ul DNA)= 31ul of water that you will need to add.
once you have this amounts down in a paper preparing the mix will be super fast and not stressful.
You must prepare a master mix based on the specifications of the materials you have purchased, such as the initial concentration of each of these materials and the manufacturer's guideline. Also in these cases, the length of the amplicon and the type of PCR are of particular importance. We can help you more by publishing a list of products.