Key
The key refers to the notes that sound "in key" and the tonal centre for the music
Generally, notes outside of the key's notes will sound "out of key" / dissonant.The key's notes will sound "in key" / consonant.
The note / chord referred to as "in the key of" will be the tonal centre of the music.
In Practical Terms
Choose a key and see the associated scale to narrow down what notes to use to sound "in key". Examples:

More Info
The referenced note & chord is the tonal centre of the music: you can use it for strong resolution (e.g. for ending the piece / beginning a new section).Considerations for choosing a key:
- Range, sound and playability of instruments and for performers
- Range, sound and playability for speaker systems
(e.g. lowest frequencies reproducible for average club speakers, popular consumer playback devices)