They vary from gun to gun. The most common are a screw in collar that surrounds the pin from behind and screws out towards the butt and small screws at right angles to the pin and that fit into notches in the firing pin.
I think what would concern me is that if this is not obvious to you, should you be changing a pin? I assume that you don't have some unusual gun in that regard.
The pin should project about .075 in front of the breach face when installed
cheers mooncoon.