How did The Beatles learn to play songs?
None of the Beatles could read or write music. And before the Internet, there were no YouTube videos to watch or chord sheets to print off.
Everything The Beatles learned about music came outside the classroom. Their early musical education was piecemeal and fragmentary. They tried stuff, kept what they liked, and junked the rest.
A key aspect was an informal 'ear training'. They learned how to listen to records to identify chords and common chord progressions.
I try to demonstrate how this worked here (4 minute free Medium read)