Assuming you mean reading
standard notation, there's a little trick to tell you the major key it's in directly as well. Without sharps or flats your in C major.
For sharps, take a semitone above the last notated sharp. So if there's only a F#, the key would be a semitone higher, G major. If there are a F#, C#, G# and D# (correctly notated in that order), the key would be E major (a semitone above the D#).
For flats, take the next-to-last flat. That will represent your major key So if there's a Bb and an Eb (correctly in that order), the next-to-last flat will be Bb, so the key will be Bb major. If there are a Bb, Eb, Ab and Db (correctly in that order), your key would be Ab major.
Note that in the key of F there is no next-to-last flat, just the Bb. You have to take that one for granted.
Of course if you know (or have good reason to assume) you're dealing with a minor key, just take the
relative minor of the major key you found. As a rule of thumb, the relative minor will be
3 semitones lower than it's major key. So C major would be relative to A minor. G major would be relative to E minor. Ab major would be relative to F minor etc.
I'm not too fond about just teaching mnemonics and ignoring the how and why, but I hope that helps!
