When set to the "safe" position, such mechanisms either prevent the trigger from moving or prevent the firing mechanism from moving or disconnect the trigger from the firing mechanism (or a combination of any of the above). Since these mechanisms typically fiddle with the working of the firearm action, the levers or buttons to activate/deactivate them are typically found close to the action as well.
There are various types of these manual safeties, such as sliding lever safety, cross bolt safety (a.k.a button safety), thumb safety etc. We will look at some of these types below.
Sliding safety or Tang safety
In the above image, we see a sliding safety lever. The lever A is a rotating lever that is rotated to lock or release the barrels from the closed state. However, lever A is not the safety. If you look behind the lever A, there is a sliding switch B, which is the safety. When set to safe, the trigger cannot be pulled.
Cross bolt or Button safety
The next type of safety is typically seen in rifles and shotguns. It is a cross-bolt or button safety. The safety is the large button labelled A right behind the trigger in the image above. When the safety is activated, it prevents the trigger from moving.
Safety/Selector lever on an AK. Click on image to enlarge.
The above image shows a selector switch/safety of an AK type firearm. The long selector lever is labelled as A in the image above. When the lever is rotated to the safe position, as in the image above, it not only locks the trigger, but also physically prevents the bolt from moving backwards fully. When rotated to either the single shot or auto-fire mode, the bolt is free to move backwards all the way
The next type of safety we will look at is the Pivot safety, where the safety lever moves about a pivot point. The above particular example also falls under the class of "thumb safety". These are typically manipulated by using the thumb to manipulate the lever, hence the name. In the above image, the lever labelled A is the pivot safety. These are common on many pistols. They work by preventing the hammer from striking the firing pin and many also disengage the trigger from the rest of the action. Some of them also serve as decocking levers, i.e. the hammer may be dropped safely so that the weapon is no longer cocked. In many pistols, there is also a corresponding lever on the other side of the slide, so that the safety can be manipulated equally easily by either a left-handed or right-handed shooter.
Click on image to enlarge.
In the above example, we see another "thumb safety" type on the pistol, but this one is a sliding button type. You can see the button directly under the red dot on the slide. Like the other thumb safety we saw above, this pistol also has another button on the other side as well, so it can be used by left or right handed shooters. Actually, this pistol has two other safety mechanisms as well, a trigger safety (note the double-trigger mechanism, the first one is a trigger safety) and a grip safety as well. We will discuss these safeties in later posts.
It must be remembered that preventing the trigger from moving only is sometimes not enough to ensure safety, as a sudden blow to the firearm in the right spot can still release the firing mechanism. Hence it is better to have a mechanism that prevents the firing mechanism from moving as well.