There are many situations where using a DI (direct input) is the best option for recording guitars. A quality DI will give you clear tone and signal with little background noise. In the modern age of digital recording, starting with clean tracks always helps when moving to the mixing stage.
The first place to start is by selecting the right DI for your studio. Most preamps offer an instrument input that can be toggled. This is a good idea because now you have the option of recording a mic or running a direct input from an instrument. You won't be able to use both inputs at the same time, but you can have them connected and just flip the switch. The GML 2032 is an excellent option for this very purpose. It has a preamp with lots of gain and a 4 band parametric EQ to sculpt the sound going in for recording. It also has a side-chain option to add outboard gear to the signal flow.
If you are looking to have something a bit more portable, consider the Little Labs Red Eye. This small box can be used as a DI and a reamp box. If you haven't explored reamping, this might be a good place to start. After you record your DI signal, you can send it back out to an amp for a reamp recording. This allows you to record the guitar part in one space and then track the amp recording at another space. You just send the output of the DI guitar recording back to the Red Eye and it will deliver the sound to the amp just as if you were plugged in.
A final note, be sure that the input signal is good when recording with a DI. If it is too low, you'll get some hiss or electrical noise when you bring up the level in post production.