There is no "simple" way that I know of.
There are at least three different methods I am aware of, and probably more...
A lot of shorter range units use simple trigonometry, measuring the angle the spot on an object is offset from the receive sensor - close in gives a high angle and further away a shallow angle. They use either an optical line sensor or rotating mirror to determine the angle.
For longer distances, either:
Direct time of flight, the delay between the transmitted pulse and the receive pulse. That needs incredibly precise timing, as one nanosecond = 15cm round trip...
A modulated beam and compare the phase of the modulation between transmit and receive.
eg. 10MHz modulation gives around 30m total path per 360' phase shift. I built a unit that worked like that a few years back, using 25MHz modulation if I remember right.
It worked to a few metres but was ludicrously complex...
You can now buy a complete off-the-shelf sensor for less than just the high frequency modulatable laser unit I used in that.