Well, that depends on what equipment you have available. Apart from the recorder that you're trying to calibrate (let's call that your "main" recorder), you'll need one piece of equipment that has an aux- or "line"-level analog input and metering of some kind; a second recorder would be ideal. You'll also need some way to generate or play back a steady tone as an analog signal (you may find that your computer's sound card can serve that purpose).
So to sum up our ingredients list, you need a tone source, your "main" recorder (the one you want to find out how to set to unity gain), and a second recorder or something else that has an aux-level analog input and usable metering.
Step one: Play the tone source into the second recorder's input, and set that recorder's input level so that you can read its meters at some particular level. The level doesn't need to be 0 dB as long as it can be clearly read. Whatever level you choose, remember it.
Step two: Disconnect the tone source from the second recorder's input, and connect the tone source instead to the input of the recorder that you want to calibrate (i.e. your "main recorder"). Now connect that recorder's output to the input of the second recorder, and play the tone again (i.e. "through" your main recorder). Adjust the input level control on the main recorder--or its output level control if it has one--until the meter on the second recorder reads the same as the level you chose in step one. At that point, your main recorder is operating at unity gain.
Note that this has nothing much to do with setting the levels on either recorder for best signal-to-noise ratio, if that's what you're looking to find. For some reason the issue of unity gain got injected into the discussion on how best to set levels for recording with a preamp, but it's almost completely irrelevant. You can see that if you consider a recorder with level controls on both its inputs and its outputs, as many recorders have; it could operate at unity gain with its input level controls at a wide range of settings as long as you always compensated via the output level controls. But obviously you wouldn't get the optimal signal-to-noise ratio at all those different input level settings, and you could run into overload problems as well. So I hope that isn't your sole purpose for this.
--best regards