A valuable way of looking at the notes on the guitar fretboard is to think in terms of positions. The position you are playing is determined by which fret the first finger of your left hand is at.
E.g. if you are playing a melody or chord where your first finger stays at the first fret, then you are in the first position. If your first finger stays at the 6th fret, you are in the 6th position, etc. The example below demonstrates a short phrase played in several different positions, as shown in the tablature. Experiment and find out how many other positions you can use to play this phrase.