system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How you can figure out what key a song is in.
gpt
Depends on how much information you have. If you just have the audio file, try looking up a chord chart or a lead sheet online, and go from there. If you can't find a chart, you'll have to use your ear to find the chord. The basic rule is whatever chord the song starts on, and ends on is the tonic, and you can use that to figure out the key. For example, if the first chord is an Em7, chances are it is in the key of Em (this rule is quite often broken, depending on the complexity of the arrangement, but it's a good starting point).

If you have the sheet music, then the key signature should be there, and you can easily work it out from that.

Hope this helps.