One of my biggest joys is listening through my playlists and harmonizing together with random songs. But to join a song, you first have to know where it lives. This site exists because of that habit · here is the exact method, with a real example.
Don't try to hear everything. Catch three or four notes from the intro or the main riff and find them on the piano or the fretboard. Hum along if it helps; your voice is a slower but honest instrument.
Feed those notes to the detector. Three notes usually leave you with a handful of possible keys. That's not failure · that's the shortlist.
Real example: "Sails of Charon" by Scorpions. The intro gave me two possible readings · C D E F# G A B, or C# D E F# G A B. One note apart. Then the song continued with a C natural, and option one won: the G major family, played from B. B Phrygian. One note decided everything.
The key's family and its mode are different questions. The family tells you which notes are legal; the home note tells you where phrases rest. Listen for the note the song keeps landing on · that's your root. Start and end your lines there and you will sound like you belong.
After a few weeks this stops being steps and becomes a reflex. The tool is training wheels · good ones. Use it until your ears don't need it.