Look at the beginning of the sheet music. Near the treble clef and time signature, you should see a key signature, which will either consist of "#" markings (sharps), "b" markings (flats), or no markings at all.
Recognize that the song is in the key of C if there are no sharps or flats marked in the key signature.
Figure out the key if there are sharps. One sharp is the key of G, two sharps indicate the key of D, three sharps equal the key of A, four sharps equal the key of E, and five sharps equal the key of B.
Figure out the key if there are flats in the key signature. One flat indicates the key of F, two flats mean it's in the key of Bb, three flats equal the key of Eb, four flats equal the key of Ab, five flats indicate the key of Eb, and six flats mean it's in the key of Gb.
Listen for the chord that the song begins and ends on. Try to hum the pitch and match it on the piano or strum a chord on the guitar that matches the sound in the song. If you can find this chord or the root note of the chord, you've probably figured out the key of the song.
Look for predominant patterns of chords in a song. The most commonly used chords in a song are I, IV and V. The I chord is the key of the song. For instance, if you're mainly hearing the chords G (I), C (IV) and D (V) , the song is in G.
Listen for shifts. Some songs modulate from one key to another. If you hear an obvious shift in the song, use the previous two steps to figure out the new key.