In a lot of metal, the tonic note will be the open 6th string (E, D, C, B, A, depending on the tuning). Once you can identify the tonic chord, based on this resolution feel, it's again just a case of finding the root and quality (major/minor) of that chord on the fretboard. This will tell you the song's key.
How do you know if a song is major or minor by ear?
When you're listening to a piece of music, if the song sounds bright or happy and uses primarily major chords, you're probably in a major key. Conversely, if the song sounds dark or gloomy and uses primarily minor chords, you're probably in a minor key.
How do I find the tonic note of a song?
We can find the tonic at the beginning of the melody, but also at the end of it. A common practice is to extract the scale of the melody. When no other pitch seems to stand out with the stability of the tonic, take the last note and arrange the other notes after it in ascending order. The first step is the tonic.