The key signature is the number of sharps or flats in a key. Why should you know them? Well, uh, it’s kind of impossible to know a scale without knowing what notes to play, and knowing the key signature basically means you know what notes to play. Why should you know scales? Because scales appear all over in music, and because your technique will improve as a nice side effect.
Next, you’ll definitely need to memorize these three:
C Major has no sharps and no flats
G Major has 1 sharp
F Major has 1 flat
After this, there are two ways of going about it. So, when I was a little kid I memorized all of them, through trial and error and just being asked about them so many times that I finally remembered which one was which. I’m pretty sure if you put some effort into it, they shouldn’t be very difficult to memorize. I think it’s more difficult to remember which rule to use (subtract two sharps, add a flat) and then to take the time and use it, but if that’s what helps you remember, go right ahead. Honestly, the two methods aren’t that different if you can rattle off the order of sharps and flats super quickly, so I’d suggest spending time on getting the orders down.
Here’s a chart to help you, from the Piano Keyboard Guide
If you want the tricks, here they are. For sharps, you count up until you reach the letter you’re searching for, and then you subtract two. For example, what’s the key signature of A Major? F C G D A – okay, that’s the letter we’re searching for, and we’re at 5 sharps. Now, subtract two ~ 5 minus 2 is three, so A Major has three sharps, F# C# and G#.
For flats, you count up until you reach the letter you’re searching for and then add one. So, what’s the key signature of Db Major? B E A D – okay, that’s 4 flats. Now all one ~ 4 plus 1 is five, so Db Major has five flats, Bb Eb Ab Db and Gb.
Another suggestion: I’d say it’s more important to know the key signatures that come up the most. Usually, that means the key signatures with fewer sharps or flats. So I’d say to make sure you know which keys have two or three sharps or flats, and then work on remembering the rest of them.
Ways to learn them: Write them down! Find some manuscript paper, like, say from this site, and copy them over. Test yourself. There are also sites on the internet, like teoria.com, that have exercises like this one: http://www.teoria.com/en/exercises/ksi.php
I know this is kinda me saying you’ve just got to trust me, and I haven’t explained yet why scales work this way or anything. I’ll get to it soon, I promise. But even when you know how to construct a scale yourself, being able to call up the key signature from memory is a useful time-saving tool.