Whether you're a hunter, target shooter, or you keep a gun for personal defense, you MUST be familiar with the four cardinal rules of firearms safety. These rules are attributed to Colonel Jeff Cooper, widely considered to be the father of modern handgunning and combat technique.
1. All guns are always loaded.
We've all heard it too many times, "But I didn't think it was loaded!" Unfortunately, many firearms accidents are the direct result of the violation of this rule. If you pickup a firearm, the very first thing you should do is check to see if it is loaded. If you don't know how to check that particular firearm, PUT IT DOWN. You should do this every time you handle a firearm, even if the person that hands it to you just checked it themselves. Because, get this, you are responsible for your own actions. If someone else tells you that a gun is unloaded, and that person happens to be a complete idiot, what happens when you take them at their word, and then proceed to break rules number 2 or 3? Even after you've personally inspected a weapon's chamber visually, you should still treat the firearm as if it were loaded.
2. Never point the muzzle at anything you aren't ready and willing to destroy.
The muzzle is the end the bullet comes out of. I mean... there are actually people out there who point guns at their friends or their dog, just goofing around. These are the same people who accidentally kill their friends or their dog. There's going to come a day for anyone who handles firearms when one of those guns is going to be fired accidentally. This is called unintentional discharge. The day this happens, the direction in which the muzzle is pointed is going to be the difference between a scare and a tragedy. Afield, or carrying in a holster, I personally always keep the muzzle pointed at the ground near my feet. When I'm disassembling, cleaning or practicing dryfire, I point it at a five gallon bucket full of sand that I keep for that specific purpose. Just be certain of where the muzzle is pointing.
3. Keep your finger off the trigger until your sights are on the target and you're ready to fire.
You don't want to accidentally fire a gun at anything. If your finger's on the trigger and you're not on target, you could very well make that terrible mistake. If your finger isn't on the trigger, then there's very little chance that the gun will fire. There are some exceptions, such as if you're holding the hammer at a partial cock on a single action revolver, but you shouldn't be doing that either. Again, this rule relates to unintentional discharge. Whereas rule 2 serves to mediate the circumstances when an accident happens, this rule is meant to prevent the accident altogether. If you follow this rule religiously, it's unlikely that you'll experience an unintentional discharge.
4. Positively identify your target, and be sure of what is beyond it.
If you don't know what or who you're shooting at, don't point your weapon at it. This goes hand in hand with rule number 2. If you don't know what it is, how can you have made the decision that you are willing to destroy it? My own mother almost shot me in the face when I was four years old, as I tried to climb into her bed in the middle of the night. Don't shoot at sounds! And often overlooked by shooters is the fact that many bullets don't stop after hitting the target. This is called over-penetration, and it can pose a significant risk to bystanders in a self defense situation. Most handgun ammunition, especially hollow point, is designed to stop in the target. But high powered rifle ammo or large bore shotgun slugs and the like can easily over penetrate. When you are firing a weapon, expect over-penetration. Don't fire at a target that is in front of something you aren't willing to destroy.
Lastly, you have to practice all of these rules religiously until they are second nature. I find myself picking up spray bottles of household cleaner with my index finger along side the nozzle, subconsciously avoiding the trigger. Let it be said, that no man is perfect. There will be an occasion where you find yourself breaking one of the rules above. The rules attempt to compensate for that, such that in the case of an unintentional discharge, at least your muzzle is pointed at something that you don't mind destroying. Or if you accidentally point it at something important, at least your finger isn't on the trigger. But we can't become complacent. If you don't at least attempt to make these rules and habits second nature, you have no business picking up a gun.
Sources:
"Jeff Cooper's Commentaries" by Jeff Cooper, Vol. 11, No. 4, April 2003
My father's advice
My personal experience