There are many different ways to prepare PBS solutions, common ones are Dulbecco's phosphate-buffered saline (DPBS) and the Cold Spring Harbor protocol. Some formulations of DPBS do not contain potassium and magnesium, while other ones contain calcium and/or magnesium (depending on whether or not the buffer is used on live or fixed tissue: the latter does not require CaCl or MgCl ).
Start with 800 mL of distilled water to dissolve all salts. Add distilled water to a total volume of 1 liter. The resultant 1× PBS will have a final concentration of 157 mM Na, 140mM Cl, 4.45mM K, 10.1 mM HPO, 1.76 mM HPO and a pH of 7.96. Add 2.84 mM of HCl to shift the buffer to 7.3 mM  HPO and 4.6 mM HPO for a final pH of 7.4 and a Cl concentration of 142 mM.
The pH of PBS is ~7.4. When making buffer solutions, it is good practice to always measure the pH directly using a pH meter. If necessary, pH can be adjusted using hydrochloric acid or sodium hydroxide.
PBS can also be prepared by using commercially made PBS buffer tablets or pouches.
If used in cell culturing, the solution can be dispensed into aliquots and sterilized by autoclaving or filtration. Sterilization may not be necessary depending on its use. PBS can be stored at room temperature or in the refrigerator. However, concentrated stock solutions may precipitate when cooled and should be kept at room temperature until precipitate has completely dissolved before use.