Lock up your gun in a theft-proof container out of sight, and out of reach of children. Store it in a manner that will keep it out of anyone's hands other than your own or someone you want to have access to it. Lock up your ammunition in a different location so that anyone who should not have it can't get to it. Some people use gun locks, and some states mandate their use. Gun locks are not as secure as a theft-proof container, so use both when necessary.
Gun locks can give a false sense of security.
Some, especially those covering the trigger, do not always fit tightly enough to prevent movement. If they can be moved, the trigger can also move. If the gun is loaded and cocked when the trigger is moved, the gun may fire even with the gun lock in place. A gun lock alone will not prevent anyone from handling the gun, and it will not necessarily prevent them from removing the gun from your home. So keep your gun locked up where no one can get to it.