You need to listen for the tonal center. That is the key the song is written in, 9 times out of 10.
Listen to the song and walk your G string up the neck, when what you are doing and what is happening in the song sound good together, you've found the tonal center. Look down at what note this happened on. That is your key.
Sheet music. Look for the chord and or note each verse ends on. If all the verses end on the same chord/note that's your key.
Look for the dominant seven chord, i.e. G7, if that is the only dominant seven chord in the song, you can be safe in assuming the song is in the key of C major, I-IV-V7 or C, F, G7.
You could list all the chords and then see what key they all fit into. Not some all. That is a last straw way of doing it, normally one of the above will get you there before you have to revert to this.
I'm sure there are other ways, perhaps others will chime in.