Accidentals (sharp , flat and natural ) alter the pitch of the next note as well as notes written on the same staff-line up to the next bar-line.
Accidentals written at the start of a staff line denote the key in which a tune is written, and are valid for all following bars, up to a key-change (if any).
In keys with lots of sharps, flats double sharps and double flats will be used occasionally.
In non-western music and some contemporary music half sharps and half flats are used sometimes
Accidentals may be entered with the accidental-menu , but are generally entered more easily using the pitch increment / decrement keyboard shortcuts <+> and <-> respectively.
Courtesy accidentals may be used when you feel they are appropriate.