Key signatures
A key signature is just the accidentals of a scale, collected and written once at the start of the line. You already know how to find them: spell the scale and read off what is not natural.
A major is A, B, C♯, D, E, F♯, G♯ — three sharps: F♯, C♯, G♯.
They are always written in the same order, never mixed and never reordered. Sharps go F, C, G, D, A, E, B. Flats go the other way round: B, E, A, D, G, C, F. Answer in that order here.
A key never mixes sharps and flats. If you find yourself wanting to, the scale was spelled wrong somewhere.
Sharps: F C G D A E B Flats: B E A D G C F
A major has three sharps — F♯, C♯, G♯, always written in that order.
Practise this in the trainer — it opens with this lesson the first time the concept comes up.