In figured bass, accidentals that are not in the key signature must be specified:
Here are some examples:
An example from Bach's cantata Ach, lieben Christen, seid getrost (BWV 114). We show the chord notes in the upper staff without pretending to make a musically correct realization of the bass. Note the use of the slash to indicate an F sharp in the first bar: