Unless you have perfect pitch you'd need at a minimum an app that has a piano keyboard so you can match the note with the sound you're hearing.
An important thing to do is listen for the key of the song. This is also called the tonic of the scale. Once you find the key, you will essentially know the 7 diatonic notes that belong to that scale. With that you can derive both the melody and harmony of what you're listening to.
The key is usually the last note the song resolves to.
So say you're going about your day and you listen to Shape of You. If you go to the very last note in the song, the key that it resolves to, is "YOU" at 3:56. The you that he sings, if you had a trusty piano app to compare it with, is in C#. His voice is the melody here. Another way, without going to the end of the song, is the root note of the first chord of the song also can indicate the key. And yet another way, is just by hearing it throughout the song, all notes want to resolve to it. You get better at identifying the key with experience.
In the beginning of the song you'll notice that there's a few notes. It starts off with: C# E C# C# E... This is a minor third interval. The note E is not in the C# major scale. So the song is in C# minor. The four chords it uses are C#m F#m A B. which are the i iv VI VII diatonic chords of the scale.
Take a look at this link it breaks down how the chords of the scale (harmony) relate to the notes of the scale (melody):
This is just a single example but alot of songs work this way. Most songs you'll find to be in a major key though.
So as you see, in order to figure out the song we had to use a bit of theory and we had to figure out what the key was.
The link that you posted is that of an advanced musician, he actually has a cool channel on youtube called Jazz Tutorial that I watch. It takes years of practicing your instrument, understanding scales, chords, theory, and ear training to be able to transcribe by ear throughout the day as was mentioned in that article.