Ok so basically it looks like this (I hope this comes out right)(the dots are just to keep the letters in place, spaces dont work)
................................
...............C................
# - F...............G........
b - B...............D........
.............E...A..............
...................................
This circle, in case you forget it, is just a circle of fifths so every letter is a fifth away from the last with C at the top, and A at the bottom.
The way to find what key or what the key signature is, you must count to the key you want to get to. Let me explain:
If you count away from the letter C in a clockwise direction you get the major key using sharps key signature, however if you count away from C anticlockwise you get the major flat keys.
So if you count to D, there would be 2 sharps in the key signature of D major, as it is two away from C going clockwise.
The sharps in question are the sharps beginning at F continuing round the circle clockwise. So for D major, F# and C#, since they are the first two sharps, and we know there are two sharps since D is two spots away from C (clockwise).
The flats start at B, going anticlockwise, so Bb, Eb, Ab etc.
If you want the minor key, you follow the similar pattern of counting, but instead of counting away from C you count away from A. The direction of flats or sharps key is the same. so counting away from "A" clockwise is minor sharp keys and anticlockwise is minor flats keys. The sharps and flats also start at the same place (B=b, F=#)
If, for example, you want to find the key signature for G major, count to G from C. If you go clockwise, there is one, showing there is one sharp (F#) in the key signature of G.
If you go anticlockwise, however, G is 6 away from C, showing there are 6 flats (Bb, Eb, Ab, Db, Gb and Cb). Notice how one flat was G? Therefore, this is not the key signature of G major, but instead of Gb major.
It's the same for minor. If you choose to find the key signature of, for example, F minor, count clockwise from A. You have 3 sharps (F#, C# and G#), and this is F# minor because one of the sharps in the key signature is F. If you count anticlockwise, you get 4 flats (Bb, Eb, Ab, Db) and therefore the key signature of F minor is this.
It works the same if you are trying to find the key from the key signature you have. If you have a key signature of 3 flats, you are either in Eb major or C minor. Its up to you to figure out if it's major or minor then you pick the appropriate one.
So sorry this was such a long explanation, I hope it makes sense? If not, don't worry, it may take a while to click. If I could make anything clearer, please let me know.
Oh, and the minor key signatures don't account for the raised 7th, that should be added as an accidental if it's not already in the key sig.
KEY RULES:
If counting away from C, the key is major.
If counting away from A, the key is minor.
If counting clockwise (from C or A), use sharps.
If counting anticlockwise, use flats.
Sharps start at F, continue counting round clockwise.
Flats start at B, continue counting round anticlockwise.