Although all sorts of electronic tuning aids are ubiquitous there are reasons why one should be able to tune the guitar by ear as well. For example to detect that it's out of tune. Here's a very common way of tuning the guitar by ear. Start by tuning the thinnest (1st) string. The first string must be E (330 Hz). You will get the right pitch from here: Play the open first string of your instrument. Listen if it sounds the same as the reference tone. In the beginning it is hard to tell the difference as instruments have different sounds and also the volume and the timbre change. When you are tuning your guitar the only thing that interests you is pitch.
If you manage to tune the 1st string, continue like this:
Press down the V fret of the 2nd string. Now pick the 1st string and then the 2nd string (that has been pressed down at the 5th fret). If both strings are in tune, they should now produce an identical sound. If they do not sound the same then try to listen carefully if the 2nd string is higher than the 1st or rather lower and adjust accordingly.
Now press down the 4th fret of the 3rd string and pick the open 2nd string and then the 3rd string (that has been pressed down at the 4th fret). Those strings should sound the same. If not, it is necessary to turn the knob of the 3rd string. Do not touch the knobs of the 2nd and 1st strings if you have already decided that they are in tune.
Press down the 5th fret of the 4th string. It should now make the same sound as the open 3rd string.
Press down the 5th fret of the 5th string. It should now make the same sound as the open 4th string.
Press down the 5th fret of the 6th string and compare its sound to the open 5th string. The sound should be identical.
Did you notice that 3rd string was pressed down on 4th fret but all other strings on 5th? That's an easy thing to memorize.
Now that you have done your best to tune the guitar by ear it's time to check the result. As both the 1st and the 6th string are the note E, they should sound very similar. It’s true that the 6th string sounds 2 octaves lower than the 1st string, but an E remains an E. Pluck the 1st and the 6th string alternately or together and listen. If it sounds very bad then you have been too imprecise in your tuning. You can also verify with the online guitar tuner app on this website. Tip! Another cool idea would be to tune by eye instead doing it by ear.