You learn how to play the guitar by constant repition of chords and / or scales. That's really it.
For those who do not know, the above are guitar chord diagrams. The vertical lines represent the six strings of the guitar. The horizontal lines are frets. In this case, the very top horizontal line is the nut of the guitar. the 2nd line down is the first fret. the next the 2nd, and so on. So this diagram is said to be in the first position.
OK, enough of that. Let me explain something. In the broadest, simplest sense you can say that all songs p-layed on the guitar are nothing more than a series of chords. It can be any pop song, Christmas song, country song, you name it. To play them you learn a series of chord changes. The same is true of guitar solos. Simple ones and complex ones by Bach. In the end, they are all a series of chords. Some more difficult than others. It is what is done with those chords that makes up the individual piece of music or a particular arrangement of a piece of music.
So here is what I am geting to. To play the guitar you must be able to go from one chord to the next. The diagram above shows a C chord and a G chord. If you have a guitar and cannot play it, or do not know how to play it, start by practicing these two chords. If you are new to the instrument you must perform the chord change hundreds of time over many days. Eventually you will become fluent with that chord change. That should be your first lesson. From that point onward everything you do with the guitar will be exactly the same as learning to go from a C chord to a G: Constant repitition. Every song or slo you learn will have to be learned by constantly repeating a series of chord changes. Some of these changes get broken up with scale passages, or various approaches to how the chords are played with the right hand, but in the end it is always the same. It is continually repeating the chord change, scale passage, or what ever, over and over, hundreds of times, thousands of times. It 's really not learning to play so much as it is developing the skill to play.
I play some rather complicated arrangement of pop songs and classical guitar pieces. To this day (after 30 years) I must play a piece over and over. If it is complicated or intricate it has to be broken down into small components, chord by chord, note by note, practiced slowly until it gradually comes together and smooths out. It is no different than when I first tackled learning to play a C chord to a G chord.