A decocker or decocking lever is the part of a firearm, on a semiautomatic pistol to be exact, which allows the operator to safely lower the hammer on a gun which has a loaded chamber. This feature is not present in revolvers as it is the natural tendency of the hammer on a revolver to reset to the lowered position after every shot. One exception of course is the semiautomatic revolver which is an oddity and an answer to a question no one asked.

The decocker is also only present in pistols which have a double action capability, decocking a single action auto will result in having a loaded gun which will not fire even if the trigger is pulled, which is not a very good idea.

The most common pistols that are equipped with a decocker are the SIG P series line of auto pistols (except for the P210 which is a single action auto), Beretta, and the H&K USP. The Glock is not equipped with any external levers aside from the trigger and slide release. The safety mechanism that allows the hammer to fall but not fire the cartridge in the chamber varies but the same principle is applied, that being not to let the hammer transfer the force to the firing pin. The Beretta does this by swiveling the part which transfers the force to the firing pin so even if it hits this part the cartridge in the chamber still won't fire. The H&K and other designs more or less drop the hammer to a half cock position which is not exactly hammer down but for all intents and purposes is already low enough that the trigger pull will be in double action and hence the pistol is decocked.

While having a pistol with a loaded chamber decocked does offer some sort of extra safety since the hammer is not under any tension, the cocked and locked gun is just as safe as long as the four rules of gun safety are followed. It is more of a visual danger for people to see that you are carrying a cocked pistol and freak out. Certain guns like the m1911 can only be carried cocked and locked or in condition 3.

Alyways use the decocker to decock a gun, if your gun has no decocker, it was not meant to be decocked. Also read why it is stupid to manually decock a gun without a decocker.