Yes, like they said
The Key Signature, or Key Sign, is a sign of the Key of the piece of music, and the Key holds the key to the Note about which the music revolves.
If you have the written music in front of you, the Key Sign is expressed at the start of the music after the treble/bass Clef, and before the Time Sign, and is indicated by the number of #' or b's in the music. Eg. music in the Key of G Major requires its F note to be # so the sharp will occur on the F line of the stave. Music in the Key of F major requires that its B note is b, so the b will appear on the B line of the stave.
Without the music in front of you, and going by ear, or by the song notes or the chords present, you need to get a sense of what note/chord holds pride of place in the song. Extremely often, a song ends on its most important or Tonic note, and that is called the Key Note. Eg. if a song ends on G, there's a good chance the piece is in the Key of G. You then need to ask the question - major or minor?
And so it goes.
It is worth learning the names of the 3 Primary Chords in each key. They are a family that hang around together A LOT. The chords are those related to the 1st, 4th & 5th notes of the scale of the key you are in.
Eg. In the key of C major ... Cmajor Fmajor Gmajor
In the key of F major ... Fmajor Bbmajor C major
In the key of G major ... Gmajor Cmajor Dmajor
Good luck in coming to understand more of the beautiful story that is Music