If you are tuning the guitar by yourself, you need to have a reference like a tuning fork, a piano or another guitar. Start with properly tuning one string first and once that is done, you only need to fret to match the sound of the other strings. See below:
A string is the same as E string at the 5th fret of the E string
D string is the same as A string at the 5th fret of the A string
G string is the same as D string at the 5th fret of the D string
B string is the same as G string at the 4th fret of the G string
E string is the same as B string at the 5th fret of the B string
You can also tune the guitar with an electronic tuner. This is the easiest and most accurate way to tune a guitar especially for beginners. There are a lot of available tuners available in the market and even apps that are downloadable from the internet. Just be sure that the one you are getting is designed to tune guitars.