This is an ear training approach that many music programs use: try to sing the tonic note of whatever chord progression you are listening to. You start by singing the tonic of chords, then move to sing the tonic of a progression, to eventually sing the tonic of a song. That's your key. By doing this you are trying to find the pitch that sounds more stable, using only your ear.
It's much easier if you have some ear training background though. Stuff like identifying intervals and simple chords.
Using this idea, and your instrument, without the ear training part (you'd be training your ear, just not as much), you can try to find the bass notes of the chord progressions, or a bass note that kind of works through all the progression.
Another way, where you need to be somewhat familiar with harmony, and know some of the chords of the song, is by looking at the quality of the chords involved. C mayor scale, for example, builds the chords C major, D minor, E minor, F major, G major, A minor, and B diminished. if you have a F major - G major - C major progression, you are probably in C major.
That's with triads, but with dominants it can be even more explicit. Search for dominant 7 chords and other chords that play that function (like diminished 7 chords), those often resolve to the tonic. There's secondary dominant chords that do not resolve to the tonic though, but they normally resolve to something important like the dominant or subdominant.
Most of the time you can get away with paying attention only to the cadences (V I, IV I, II V I, etc), since they normally paint a pretty good picture of the tonality.
By scales and melody
Sometimes when learning new songs, I try to play some important parts of the melody on my guitar, and then improvise a little over that idea. At that point the key becomes apparent most of the time, since the key is based on scales. If you can play F G A Bb C D E (doesn't need to be that order) and it sounds cool, you are probably in F major or D minor or any of the parallel keys.
For the three approaches, remember that harmony can get tricky. For the minors we have common variations like harmonic, melodic, and dorian. So it's very common that the 6ths and 7ths are "displaced", along with some of the harmony. There's also key modulation, and music that lacks tonality and key!
But for the less exotic songs, which are the huge majority, you can keep it simple.