Know how a nail gun works.
Mechanics of a Nail Gun - There are two types of nail guns: those that use an air compressor and those that are cordless, or battery-operated. A nail gun that works off of an air compressor is called a pneumatic nailer, and the air compressor is attached with a hose. The nails are lightly glued together for easy loading, and the glue provides extra stability when the nail is shot into wood.
How Nails Are Released - When air pressure flows into the gun from the compressor, it is stored in a chamber until the plunger, located at the muzzle, is depressed and the trigger is pulled. A properly working nail gun will not fire until the plunger is pressed against the object you're nailing. When the plunger is depressed, the air pressure is allowed to flow through the chamber, above a piston that is attached to a blade. Located above the piston is another plunger. The compressed air forces the plunger up and allows the pressure access to the top of the piston.
Firing a Nail - When you pull the trigger, the piston is forced down and the attached blade separates the nails, which are then propelled out by the stored pressure. After the trigger is released, the inner plunger rises back to the top and blocks air flow to the piston until the outer plunger is compressed and the trigger is pulled again.
Cordless Nail Guns - A cordless nail gun works without compressed air, making it easier to use in hard-to-reach areas. This nail gun has a combustion chamber above the piston instead of a plunger. A canister is used to fill the chamber with gas. The gas ignites from an electric charge that is created by the battery and explodes inside the chamber when the trigger is pulled. This explosion drives the piston downward. Like the pneumatic nailer, the cordless nailer has a blade attached to the piston that separates the nails as they come out of the gun. The cordless nailer also has a safety mechanism like the pneumatic nailer. It will not fire until its tip is compressed against the object you are nailing.