Simon, just thinking a touch more.
Key signature: group of sharps/flats/naturals at the beginning of a bar or stave - applies to all notes of the same name, irrespective of where they are in the stave. This sets the overall key of that part of the music and is in effect either until the next key signature is reached - or until the end of the music.
Accidental: sharp/flat/natural in front of a specific note - temporary change, valid for the rest of the bar, overrides the key signature for that note only for the rest of the bar, or until another accidental supersedes it in the same bar. Other notes of the same name in the bar are not affected. However there are rare instances where the rule is broken and all notes of the same name for the bar are affected. This you generally don't need to worry about, unless what you're playing sounds wrong and sounds right when you apply the accidental to all notes of the same name. Sometimes you'll see an accidental where it's not necessary, often in brackets - this is put in as a reminder that the accidental in the previous bar no longer applies.