Playing by ear is a search, and it goes much faster if you search in a fixed order. Find the key first, then the bass note under each chord change, then the melody on top. Most popular songs are built from three or four chords, so once you have the bass line you have usually already found the song. The guessing never fully goes away, but it gets dramatically better at guessing.
Start with the bass, not the tune
Almost everyone does this backwards. You hum the melody, hunt for it one note at a time, and end up with a thin single-note version that never sounds like the record.
Flip it. Listen for the lowest note in the mix instead, the one the bass player is on, and find that on the keyboard. That note is almost always the root of the chord, so finding it hands you the whole chord rather than one note of it. Do that for each change and you have the skeleton of the song in a couple of minutes.
Try three chords before anything else
Take the note you decided is the key. Count up to the fourth and the fifth notes of that scale. Those three chords, built on the 1st, 4th, and 5th, will get you through a startling number of songs. In the key of C, that is C, F, and G.
Treat that as the default rather than a beginner's shortcut, because it is how the repertoire is actually built. Dominic Pedler's book The Songwriting Secrets of The Beatles calls it the three-chord trick and spends a chapter showing how much of pop and blues never really leaves those three chords, even in the hands of writers who could go anywhere. Make those your first three guesses and you will be right more often than not.
Learn to hear which chord wants to come next
This is the skill that separates slow ear players from fast ones. In any key, one chord audibly leans home. Play G in the key of C and you can feel it pulling towards C, like an unfinished sentence. That is the dominant, and Pedler devotes his opening chapter to why the pull is so strong: the note a semitone below home rises into it, the interval inside the chord squeezes shut, and the bass falls a fifth, all at once. You do not need that theory to use it. You need to notice the lean, because it tells you what is coming before you have played it.
The softer version is worth knowing too. A chord that feels like it is settling home gently, more "amen" than full stop, is usually the fourth chord resolving to the first. Once you can tell a hard landing from a soft one, you can predict most endings.
When a chord sounds wrong and right at the same time
Sooner or later a song throws in a chord that is not in the key, and this is where people decide they have no ear. That chord is a known move, and it has a name.
Pedler catalogues the common ones, and three cover most of what you will meet. A minor chord where you expected a major one, usually the fourth, is borrowed from the parallel minor key, and it is why songs go wistful for a single bar. A chord that behaves like a dominant but drops you onto a minor chord instead of home is the deliberate surprise, the interrupted cadence. And if you keep hearing a chord built on the flattened seventh, with no leading note anywhere, the song is modal rather than changing key. Try those three before concluding the song is doing something exotic.

