The use of sharps and flats means that the same note can have two different names. For example, F# = Gb and G# = Ab. These are referred to as enharmonic notes. The following diagram outlines all of the notes in the First Position on the guitar (including both names for the enharmonic notes). The first position consists of the open string notes and the notes on the first four frets.
The following example demonstrates two octaves of the E chromatic scale. Notice that sharps are used when the scale ascends (goes up) and flats are used as it descends (goes down). This is common practice when writing chromatic passages in music. As with any example containing new notes, it is important to name the notes out loud as you play through this scale.
Now play this example which makes use of sharps, flats and naturals.