It can take quite a while to remember what the key signature of any particular tonality or key is. There are a few different methods to help you keep track of which key has what key signature.
The first method that I think is simple and straightforward to work out a key signature is by figuring out according to the tones and semitones (whole steps and half steps). A major scale , any major scale will have the pattern of :
Tone, Tone, Semitone, Tone, Tone, Tone, Semitone
(whole step, whole step, half step, whole step, whole step, whole step, half step)
The harmonic minor scale has:
Tone, Semitone, Tone, Tone, Semitone, Tone and a half, Semitone
(whole step, half step, whole step, whole step, half step, whole step and a half, half step)
Absolutely every type of key you care to name has a certain pattern of tones and semitones, so if you become familiar with these patterns, you will always have the capability of working out what the key signature is of any key at all.
A second way that you could work out what any key signature is using the cycle (or circle) of fifths. If you love recognizing a pattern, you will love this method, because once you understand the pattern, it becomes very easy to remember. Quite some time ago, I wrote a blog post all about the cycle of fifths. Check it out here: https://pianoforretirees.com/a-guide-to-the-cycle-of-fifths/
My favorite way of checking for infrequently used keys and working out what the key signature is, is to play the scale on the piano. As a result of learning scales as a kid and teenager, I don’t have to actually think about how to play them, as they are all part of my muscle memory. It is like my fingers know exactly where to go without my brain being needed, so for me, it is a quick and easy way of checking what is in the key signature of any key.