The Key Signature is located at the start of the piece and indicates the key of the piece. Most pieces of music are in a key meaning that they use the notes of a particular scale. For example, G major will use the notes in s G major scale (for the most part) and also the chords that are derived from this scale. The G major scale includes a sharp note: F sharp, so this is placed at the start of the piece. So we can say that the key signature of G major is F sharp.
Always look at the key signature before you play a piece as this will tell you what notes will be sharp or flat for the rest of the pice.
Here are some key signatures you should know: