What is the order of sharps and flats?
The sharps are added in the order F, C, G, D, A, E, B. The flats are added in the reverse order: B, E, A, D, G, C, F.
Each new key with sharps adds one more sharp to the end of the list. G major has F♯. D major has F♯ and C♯. A major has F♯, C♯ and G♯, and so on.
A phrase helps. For sharps, try "Father Charles Goes Down And Ends Battle". For flats, read it backwards: "Battle Ends And Down Goes Charles' Father".
Flats work the same way. F major has B♭. B♭ major has B♭ and E♭. E♭ major has B♭, E♭ and A♭.
Want to practise it? Try the key signatures and naturals game, one minute a round.