There are a number of ways of tuning the guitar, but there is only one way that I recommend: buy and use an electronic tuner. Not only will your playing sound better, but you cannot develop an ear for correct pitch if you are playing an out of tune guitar. Even if the instrument is in tune with itself, but out of correct pitch, you will not develop your ear properly. Electronic tuners cost a fraction of the price of a guitar, and are easy to use. Tune before you play, and re-tune frequently as you play.