The shadow method
At the same moment, the sun's rays hit you and the object at the same angle, so height divided by shadow length is the same for both. Multiply your height by the object's shadow, then divide by your own shadow.
Example
You are 170 cm tall with a 120 cm shadow, and a tree's shadow is 14 m. The tree is 170 × 1400 ÷ 120 ≈ 1,983 cm — just under 20 metres.
The angle method
Stand a measured distance from the base, find the angle to the top with a phone clinometer, and use height = distance × tan(angle) + your eye height. It works on cloudy days when there are no shadows.