I can tune, or nearly tune a guitar by ear ( always out slightly but good enough)
takes years i tihnk. Get the note of c or F in your head. relate it to other sounds. i.e. years ago the "dead tone" on a tlelphone was the note C ( not sure if it still is) I used to pick the phone up and listen to that and tune the note C to that for begining with to train my ear to that sound.
Also , thin kof songs that are tuned, I.e. AC dc tunes, pick a song and learn it of by heart, every time ytou go to tune, think of your chosen song.
And lastly, learn a silly wee tune like yankie doddle dandy etc, lean it note perfect, and tune your guitar accordingly.
hope that helps