The time it takes the sound to come back tells you how far away it is: if it comes at a higher pitch, it's because the thing is moving toward you; if it comes back at a lower pitch, it's moving away from you.