Yeah, I know. ...you learned about these in middle school. You had to memorize the sharps and flats for the test and immediately forgot them. I don't blame you. Many times key signatures are taught without any background information or application and players tend to ignore them. Here I will explain where they came from and why we as players need to know then.
Ok, we are monks around the 11th century. When we chant in the "mode" that starts from C to C, the melody ends convincingly (called a perfect cadence). However, when we chant in any of the other "modes", they don't (called an imperfect cadence). This turned out to be frustrating. The monks then altered the other modes to make them look and sound like the C to C mode (called "musica ficta"). This yielded each of the modes to have a series of sharps or flats added to them and the key signatures were born. Now, understand this process actually took the better part of 600 years to fully develop. The key signatures allow a person to sing or play a song, then another sing or play starting on a different note (meaning a different "key") and the song sounds the same. It also allows different instruments, even with different tunings, to play together.
The key signatures and the tempered scale are two of the most important developments in music. Without them, the music we play would not be possible.
Key signaures help the player to know what the notes of a chord are and how to alter them if needed. You can't flat the 3rd of a chord to make it a minor unless you know what the 3rd is first!
The best way to learn them is to write them out. You can find key signature diagrams online or your teacher can provide you with one. For example, key of D. 2 sharps F# and C#. the Scale is DEF#GABC#. Do the same with all the key signatures. Then spell a major chord in a given key. Then alter it to be minor, augmented, diminished, 7ths, etc. Play the chords or have a friend do so so you can hear the differences the altered tones sound like. Knowing the chords in your mind, ear and hands will give you better to make music.
Feel free to contact me with questions. Lots of luck!