To know the amount of yeast there are a couple of ways. You could use a suitable microscope and a chamber(e.g. a hemocytometer) with fixed volume and count how many cells are found in this volume then multiply. Although quite accurate, it can be time consuming. Usually the optical density of the slurry is measured at 600nm wavelength using a specific device (I mean in the lab conditions 'usually'). This correlates with the amount of cells because cells will absorb/scatter some light and the more cells in solution, less light going through the cuvette containing the slurry. This correlation will be ~linear at low cell density and less linear at high density. It can be used to make a process repeatable or detect the active growth phase of the culture. Then there are some extremely expensive electronic devices in laboratories to sort even single cells of certain type.
Without any equipment, you could probably weigh the contents of the container without growth media or simply estimate the height of the yeast pellet at the bottom. This is not too accurate (not counting the individual cells) but I think it will be enough to repeat a procedure (a beer recipe) in essentially the same way. There's also a maximum cell density that the culture is going to reach before the nutrients are consumed and that is not going to change too much. That's why a starter with certain fixed volume (and fixed gravity) tends to contain (roughly..) equivalent amount of viable cells each time, even if the amount pitched would vary a bit. However, if you pitch way too much into a starter, then there can be much more cells cause the max density could be exceeded already when pitching. This method is preferred at homebrewing. You take some approximate amount of cells (from liquid yeast package from a company or from the bottom of the container) and grow them in a fixed volume of wort with fixed OG. Then you arrive in the right ballpark and you are able to repeat the procedure.