The natural sign has no effect on what came before. It does affect any
Fs afterward (but see below), but only until the end of the measure. Once the next measure begins, the
F# comes back into force.
The natural sign only affects
Fs on the same line or space as the one where the natural sign occurs. If there's another
F in the same measure, but on a different line or space, then the natural sign does not apply, and that
F will be an
Any key signature, whether it has sharps or flats, dictates which notes will be affected subsequently in that piec, until cancelled or suspended. On piano (tagged), they will generally change a white key into a black one.
Accidentals are temporary changes to any note. They may be naturals (♮) which make an already sharp or flat note revert to a white key, or change an already white key into a sharp (♯) or flat (♭).
Accidentals will always be shown just before the actual note affected - in that octave only - and will be active until the end of the bar it appears in, unless cancelled (changed) by another accidental immediately in front of that same note later in that same bar. They are not used retrospectively!
This explanation of 'black' and 'white' keys does not include notes like C♭ or E♯!