For instance, let's say you're learning Stairway to Heaven - how do you figure out what the chords are? Because, that whole intro for the most part are single frets being played and you wouldn't know what chord shape to use.
the first thing to do would be to know your notes, what key they are playing. this will shorten the list of possible chords to search for.
second,figure out notes from one phase, write the notes down and see what chords does these notes form in your key then try to play the chord over the song to see if it match. most of the times, you will find that there are more notes played, like AddChords and susChords. when you figure out the basic chord these notes can be easily introduced later on.
Of course this will take some time first, but with proper training and experience you will figure songs all out just by listening to them later on.
First figure out all the notes in the section and what chords/riffs are played. Then find out where they fit best on your guitar so you can play them easily. Two players may play the same part using different chord shapes and note fingerings and still be playing the same notes. The exact shape/position doesn't matter as long as you are playing what you need to be playing.