What you need is ear training. The main skills are:
- ability to recognize what you hear (intervals, chords, rhythms, melodies)
- ability to sing something you hear (e.g. repeat the notes or a melody you hear, repeat rhythm)
- ability to sing something you haven't heard before, e.g. by reading it from a music score
It is normally part of education in music schools, but there are also individual courses and other materials in the internet, even phone apps. Look for ear training learning materials, or a teacher – this will help you to work efficiently.
The exercises you describe seem fine to me. Play something and then try to repeat it with voice. At the beginning go slowly, with short phrases, even as short as one or two notes. Identify parts of the song that cause more trouble and work on them more. As you get better, invert the order: first sing, and the check on piano if you sung it right.
While it's not strictly needed, it will help you to learn some basic music theory (if you don't know it yet), mainly: intervals names and how they sound, and also reading scores. E.g. if you learn that C-E is a major third, then if you need to sing D-F#, which is also a major third, you will know to sing the same thing, just starting from a different note. You write that you have trouble with "understanding" what you hear – this is exactly what music theory is for.
Concerning songs, if it helps you to play music on piano, look for scores – it should be easy to find scores for popular songs.
Issues with singing in pitch may also originate from lack of voice training. You mention that you "hum". Perhaps you're shy to sing loud and don't use good breath support? That would surely affect the intonation. This is where a singing/vocal teacher can help, and with a good teacher you can make good progress already after several lessons.
Finally, I'm not exactly sure what you mean by "matching". I should mention that there are two types of hearing: relative pitch and absolute pitch. If a person with good relative pitch knows that a song starts from some note, e.g. C, and hear that first note played, they are able to follow and sing the whole song. However if they don't hear that first note (or other musical cue), they may sing the whole melody shifted up or down, e.g. starting from D or B. A person with absolute pitch doesn't need that first note. Most of the people, even most of the musicians have only relative pitch. Absolute pitch isn't really something that can be learned. Relative pitch can be trained and that's where you should put your work.