The key signature will give you information about the tonal area of a piece. The key of your instrument is relevant to reading a piece of music. If you play a Bb or Eb instrument, for instance, you will need to determine the "concert" pitch or what it would be played in on a C instrument such as flute or piano.
With modern or improvised music you may have key changes within the piece and so the best way to determine key is to find where the piece comes to rest. Look at the last bar of the music. What is the last note or chord? Almost invariably it will be the tonic or first note of your key.
Also because major and minor keys have the same key signatures it is useful to know about relative keys. The key signature for C major, for instance, will be the same for A minor, except if you look at the melody or chords they will have a different seventh degree.
C major scale: cdefgabc ; b is the 7th
A harmonic minor scale: abcdefg#a ; g# is the 7th
A complete knowledge of scales, major and minor, will help you enormously.
If you are playing pop or folk music with a few repeated chords look at or listen for the I and V such as G (I) to D (V) [I = tonic, V = dominant]. This will stick out if you listen to the tune and will tell you that the key is G.
For further understanding, look up the words cadence, dominant chord, tonic.
When you receive the score for a piece of music, one of the first things you need to do is to check the score to determine the key in which the song is written. The specific staff of the music you'll be using will vary depending upon the instrument you will be using to make your music; you may be looking at a treble clef staff of music, a bass clef staff, or both.
Regardless of the type of staff you are using, the key signature of the piece will be indicated by the presence or absence of sharps or flats. If there are no sharp or flat signs, the music is in the key of C major. If the music clef shows one or more sharp signs (#), the key of the piece will be one-half step up from the tone of the sharp farthest to the right. If there is one flat (B flat), the piece is in the key of F major. If there is more than one flat, the music is set in the tone of the second flat from the right.