Encoders are hardware that measure rotation. The encoder generates pulses that contains the information.
Rotation is directly proportional to distance. One revolution of the encoder can relate to a certain amount of distance:
encoder ticks * K = distance, where K is the distance of one rotation divided by the ticks of one rotation. K is a decimal (double).
A very simple way of determining K is to read the encoder values (console, SmartDashboard, etc.) while rotating the encoder. For example, K for a drive train can be found by moving the robot forward one rotation of the wheels. The distance traveled is the circumference of the wheels, and the change in ticks (final tick - initial tick) can be found using the console/SmartDashboard. The units for distance can be arbitrarily chosen depending on the need.