There are a few ways -- some are impractical (like lowering a long rope down the side)
We have some choices from mathematics. One is to use similar triangles from geometry, and the other is to use a branch of geometry which is right-triangle trigonometry.
(1) Suppose the building is located in place where we can measure the length of its shadow. Then we need only measure the shadow of another object whose height we know, say a meter stick, and we can use similar triangles.
If the meter stick casts a 2m shadow, and the building casts an 80m shadow, then we can set up a proportion `1/2=h/80` where h is the height of the building. (Here the height would be 40m)
(2) If we can accurately measure the angle from a point on the ground away from the building to the top of the building we can use trigonometry. One way to do this is to use an inclinometer (clinometer).
Once you have the distance from the base of the building and the angle of inclination (angle from horizontal to the top of the building) you can set up a proportion using the tangent function.
If the angle of inclination is `alpha` , the distance to the building d, and the height of the building h we get `tanalpha=h/d` or `h=d tanalpha` .
**Note: If you use a simple inclinometer (say a protractor with a weighted string) and measure from your eye, do not forget to add in your height (to your eye) for the best accuracy.**