Q:

How is coefficient of friction calculated?

How is coefficient of static friction and coefficient of kinetic friction is calculated in real life without knowing the frictional force?

A:

I can not give you an example for all surfaces, but for an inclined plane, the formula is pretty straightforward. Suppose you wanted to find the coefficient of friction between a block and an incline. Keep the block on the incline, and if the block is stationary, try to increase the angle of incline until the block just begins to slide. At this point, the force on the object is just equal to the maximum value of static friction, i.e. $\mu\ mg\ \text{cos}\ \theta$ where $\theta$ is the angle of incline. And what is the force on the object? Well, it's the other component of weight i.e. $mg\ \text{sin}\ \theta$.

For equilibrium condition, you equate these two-$$\mu\ mg\ \text{cos}\ \theta=mg\ \text{sin}\ \theta$$
from which you simply get- $$\mu=\text{tan}\ \theta$$
For an increased accuracy, repeat the above experiment with heavier/lighter blocks, different inclines of the same material, and also take care to keep the surface smooth enough to allow a uniform incline. Take the mean and you will get a really close value.  Note that in this answer I have simply shown a really general method which is far from rigorous, but I hope this still helps

