Guitar tuning, like playing the guitar itself, is relatively easy to learn but fairly difficult to master. Many beginning guitarists are initially put off by how difficult it is to get the guitar in perfect tune, but once you understand a few basic concepts, tuning the guitar isn't that hard, so long as you grasp that with a guitar perfect tuning isn't possible, given the temperament of the instrument, but we'll talk more about that later.
Broadly speaking, there are two ways to tune a guitar, either by using
the guitar itself as a reference point (once you've established at least
one note by an outside instrument) or by using an electronic tuner. I
think it's important for every guitar player to know how to tune a
guitar by ear, using just a reference tone (like a piano or tuning fork)
to get started.
The traditional way of tuning involves matching
the open notes of one string to the fretted notes of another. For
example, let's say that you have tuned the fifth string (the A string,
the fifth note UP from the bottom) to a piano, so you have at least one
note in tune. You can then tune the low E string (the thickest one, the
sixth string up from the bottom) to the A by pressing down the E string
on the fifth fret. You continue the process up to the high E string (the
first string up from the bottom). In this method, octaves also work or
can be used to check the accuracy of the fretted notes.
While knowing some ear-based tuning method is important, it's a simple fact these days that true professionals (whether guitar repair shops or players themselves) nearly always use digital tuners. Such tuners are simply far more accurate than any human ear, and they make tuning the guitar a much easier task. Not only are digital tuners more accurate, but they are also relatively inexpensive.
Available in stand alone or
pedal format (or even as smartphone apps), a high quality tuner can make tuning and intonating (more about that later) an instrument much
easier. A popular choice among many players are so-called contact
tuners, which actually attach themselves to the guitar's headstock and
provide accurate tuning from the guitar's vibrations. These tuners are
relatively unobtrusive and inexpensive.
This is just a brief introduction on the issues involved with tuning your guitar. Please feel free to ask any questions about tuning, intonation, or the proper tuner for your needs!