How to run the test
Load filament and heat the hot end to a temperature that suits it. Mark the filament about 70 mm from where it enters the extruder, then measure that distance as precisely as you can with digital calipers.
Send G91, then G1 E50 F60, which asks for 50 mm at a slow rate. The move takes about 50 seconds. When it ends, measure from the same edge to the mark again. The filament that moved is the first distance minus the second.
If the filament moved more than about 2 mm more or less than you asked for, set the new value and run the test a second time.
E-steps in Marlin
Marlin sets the steps for each millimeter of filament with M92 and the letter E. M92 with no parameters reports the values the printer uses now, and M503 does on older versions. Marlin’s own example for a new extruder is M92 E688.4.
The new E-steps are the old value times the length you asked for, divided by the length that moved. An extruder that moved 48.5 mm of 50 at 93 E-steps needs 95.88.
Rotation distance in Klipper
Klipper sets the extruder by its rotation_distance: the length of filament that one full turn of the stepper motor moves. That works the other way round from E-steps. The new rotation_distance is the old one times the length that moved, divided by the length you asked for, rounded to three decimal places. It goes in the [extruder] section of printer.cfg.