The formula for mechanical efficiency is 100(Wo/Wi), where Wo is the work output and Wi is the work input. Work is a product of force and distance, so the two are interrelated. Because of the laws of thermodynamics, some energy is always lost to heat, sound or another factor.
For example, if someone pushes one side of a lever with a force of 300 newtons and moves it 1 meter, he has done 300 joules of work. If the other end of the lever moves 0.75 meter and exerts 200 newtons of force, it performs 150 joules of work. Plugging these values into the formula yields 100(150/300), or 50 percent. This lever is 50 percent efficient.