Being able to recognize the name of a note when you hear it without context is called “perfect pitch” and I’m not sure if it can be developed if you don’t acquire it when you’re very young. (See this discussion.)
It’s possible to develop relative pitch though — that’s when you can identify all the musical components based on their relationships without necessarily knowing the exact note names.
I’m not sure if it’s what you’re looking for, but I recently stumbled on a free online textbook about music theory. In chapter 2 it describes how scales are constructed, including the C Major scale (cdefgab).
Once you know how the major scale is constructed, you can learn about the names of intervals and then triads (chords) that are built on each note of the scale using intervals. That’s where things start getting really interesting. Once you learn how chords are built on the scales, it helps with identifying common chord progressions by ear and also with writing your own music.
Here are two videos that might help:
One way to learn to hear intervals is to find melodies that use intervals. The melodies work like mnemonics. For example, if you hear two notes that sound like the theme from the Jaws movie, it’s a minor 2nd interval. If you hear something that sounds like the first two notes of Somewhere Over the Rainbow, it’s an octave. If it sounds like the difference between the 1st and 3rd note of Somewhere Over the Rainbow, it’s a Major 7th interval.
Here’s a useful website that generates a list of songs to represent each interval.
Once you learn how intervals and triads work, you can practice ear training with the exercises on a site like teoria.com.
There’s also a free music theory course on Coursera that might be interesting.