Tuning your guitar is probably the most basic, but most important thing you should do before playing your guitar.  Its probably easiest to just buy a guitar tuner, they cost about $20 and they're really the quick and easy way to tune your guitar with 100% accuracy.  However, if you don't have a guitar tuner and you want to tune your guitar, here is the method that I use...there are many others, but I find this to be the easiest to understand.

      We start at the 6th string, this is the fattest string on your guitar, and when played open its an E note.  You will need either a harmonica, pitch pipe, tuning fork, or any other instrument so you can hear the note.  All you do is turn the tuning peg until the note on the guitar sounds like the E note that you've just played.  Once you have that first note you proceed in an orderly manner tuning one string after another.  Press down on the 5th fret of the 6th string...then play the 5th string open.  The 6th string with the 5th fret pressed down is the same note as the 5th string played open.  Turn the tuning peg until the 5th string sounds like the 6th string with the 5th fret depressed. 

       Now the pattern continues and you press down the 5th fret on the 5th string...then play the 4th string open.  Once again, tune until these two notes sound the same.  Then move onto the next string...Press down on the 5th fret of the 4th string and tune the 3rd string to this note.  Once you get to the third string there is a different pattern...you press down on the 4th fret of the 3rd string and then tune the 2nd string to this note.  Finally you press down the 5th fret of the 2nd string and tune the open 1st string to this note. 

      There you have it, a tuned guitar, as a sidenote, you can tune your guitar without having the 6th string in tune with E...this just will mean that your guitar is in tune with itself, but you would need to tune it to the E if you wanted to play with other musicians.

      This is also called standard tuning [E A D G B E] and is used by most guitarists, however, this is not the only way to tune your guitar.  You can tune it in any variety of ways...but for the beginner this is the tuning that you'll most likely always use.