There is a "standard" set of four rules of gun safety. It's a good idea to learn and practice them, and to ensure you understand them. In fact, I think you should learn them even if you intend to never touch a gun in your life, just in case.
Always treat a gun as if it is loaded. (This is sometimes phrased "All guns are always loaded.")
Always point the gun in a safe direction. (This is sometimes phrased "Never point a gun at anything you are not willing to destroy.")
Keep your finger off the trigger until you are pointing it toward the target and are ready to fire. (A short name for this practice is "trigger discipline". Some people actually find someone displaying good trigger discipline physically attractive. I'm not kidding. Regardless, practice good trigger discipline constantly, even with airsoft, Nerf guns, and squirt guns. Just do it. It'll help keep your cool range photos from being mocked on Twitter or reddit, too.)
Always be sure of your target and the background. (The idea of "the background" is sometimes phrased "whatever is beyond the target".)
A key practice implied by the first rule is that, every time someone hands you a firearm, every time you pick up a firearm, every time you prepare to pack up a firearm to go home from the range, every time you put down a firearm, and so on -- every time there's a significant state change in the firearm -- you should check whether it is loaded. In most cases, this means "clearing" the firearm, which means not only ensuring that it does not have a round in the chamber but (usually) also ensuring the chances of it ending up with a round in the chamber are as close to nil as you can reasonably get them in those circumstances and ensuring that it is obvious to anyone else present that it is "clear".
In almost all circumstances, you should only hand a firearm off to another person if you clear it just before handing it over. If it has already been thoroughly cleared (e.g. a handgun with the magazine removed, no round in the chamber, and the slide locked to the rear), look at it to make sure you see an empty chamber and can tell there is no way for a round to get into the chamber short of intentionally loading it (e.g. look through the ejection port at an angle so you can see daylight coming from the empty magazine well). In some circumstances, such as one person teaching another how to handle firearms or dealing with an active threat, it may be necessary to hand over a loaded firearm, but the gun should be in as safe a condition as possible in such circumstances. Upon receiving the loaded firearm, the recipient should still double-check to be entirely certain of the firearm's condition, threats to life and limb permitting. Many modern semi-auto handguns have a small notch within the ejection port that allows you to see the color of the cartridge casing's metal when there is a round in the chamber, which can aid in ascertaining whether it is clear or ready to fire.
The first rule essentially implies the other three, but the other three are not always made obvious by the first rule, which is why they're elaborated as additional rules. The second rule essentially implies the fourth, but it's too easy to fail to adhere to the fourth if you do not articulate it (and think about it) separately, so it gets presented separately. If you utterly fuck up at one of them once, but carefully maintain the other three, you may look like an idiot and a danger to yourself and others for a moment but you should at least not hurt anyone in the process.
The second rule usually means keeping the gun pointed at the ground, several feet in front of you where you can be sure there is nothing important between the gun and the ground, and aligned with the direction you expect to fire it if you are in circumstances where there is an intended target (in short: the direction of "in front of you" should be "downrange", which means "in the direction where the targets are set up"). It also means you should never "flag" anyone you don't intend to shoot (i.e. never move the firearm such that the point of aim crosses over a person, unless facing circumstances where, e.g., that person is an attacker and you must defend yourself or die).
The third rule is typically practiced by keeping your trigger finger (generally the index finger) straight, against the side of the firearm, above the trigger guard and trigger. Some people have slightly different habits, such as having the finger slightly bent with the tip against the side of the firearm above the trigger guard. Some with long enough fingers lay it across the trigger guard so that the tip of the finger is safely far enough beyond the front of the trigger guard that it won't suddenly slip in and hit the trigger under adverse conditions. Some keep all fingers below the trigger guard, on the grip/handle/whatever. The straight finger above the trigger guard and the finger wrapped around the handle below the trigger guard are my favorites for safety, though below the trigger guard makes it more difficult to properly bring your firearm into action if needed. The other two may slightly increase the likelihood of a jostle or other unexpected movement to cause the finger to slip into the trigger guard and land on the trigger. The respective shooter must ultimately make the decision of where to keep the trigger finger away from the trigger, as an individual. The most important factor is keeping the finger away from the trigger in a stable manner until entirely ready to fire.
The fourth rule is, hopefully, self-explanatory. If something you do not want to destroy (e.g. a friend or family member, or even your television) is behind your target or very near the target, a miss or a shot that passes all the way through the target may ruin your day and likely someone else's day as well. Avoid committing accidental harm. Some implications may not be entirely obvious, though. As much as reasonably possible, be aware of your surroundings so you might have time to react by taking your finger off the trigger if someone or something is about to move into your field of fire, too. Ideally, nobody should be within about a 170 degree angle in front of you when you fire, or perhaps even 180, especially if anyone is very close to you on either side. The farther away they are to the side, the harder it will be for them to stumble into your field of fire because of a strong gust of wind, someone bumping into them, changing position and stepping on a spent casing that rolls underfoot, or just a knee buckling because yesterday was "leg day" at the gym.
You should practice all four rules until they are completely automatic, but even then you should always think about them every time you handle a firearm (or are around anyone else handling a firearm). Sometimes automatic habits slip, so don't only rely on the automatic nature of the habit. Sometimes one might suffer a defect in attention and thus fail to consciously maintain the four rules of gun safety, so you should endeavor to automate the habits as much as possible. Attention and habit automation each back up the other in case of a momentary slip that could kill someone.
It's the same as always looking over your shoulder before changing lanes, backing up your car, or any of a number of other typical driving operations. You don't want to turn right and cream a bicyclist who came up alongside you at the stop sign when you're driving your F-350 (or, if you do, you're a horrible person) because you forgot the head check to back up the mirror check, and you don't want blow a hole through a family member's groin because your trigger discipline slipped.
Should you be able to recite them, quickly and easily? Yes, that would be great. Ideally, you should be able to articulate them fully in your own words, instead of just relying on rote memorization, too. On the other hand, if you ask me to list them verbally, I might forget one or two. Amusingly, the one I am most likely to forget when testing my memory of them is keeping my finger off the trigger, but only because it has become so thoroughly ingrained in my muscle memory and my manner of thinking in the moment that it slips my mind that it is an actual elaborated rule rather than a basic life skill like "drink fluids to stay hydrated". While I might occasionally lose points on a verbal test, the real test is when actually handling a firearm.
I in part relied on actually handling a gun to recall the four rules when preparing to list all four of them. That's how much these things are wired into my brain in connection to my proximity to firearms, and I still make a point of thinking about it in the moment to monitor my maintenance of habit.
Still, if you do better than me at being able to recall all four off the top of your head when asked to vocalize the rules, you're less likely to get mocked.
You might think something like "What if I already checked it and I know it's not loaded?" but it doesn't matter. Ultimately, there are no exceptions.
Oh, sure, if you absolutely know for certain that it is not loaded, it might be safe to point it at your femoral artery while checking its functionality, just this one time. There's a big problem with exceptions, though:
Exceptions are part of your habits, and bad habits can get you killed. Keep the rules simple; keep your practice of the rules straightforward and consistent. The only times I am willing to excuse an exception are:
when not making an exception can get someone killed (which is basically "never")
when you just made a mistake because you're new to this or otherwise had a dumb moment, realize you made a mistake (whether recognizing it without help or someone immediately pointing it out), nobody got hurt, and you learn from it
There might be cases where I still won't excuse an exception under either of these exception conditions.
If you never make exceptions, you build stronger habits. Ignore that little voice in the back of your head telling you that you already checked it. If you pick up the gun, you check to make sure it's loaded. There are NO EXCEPTIONS, because some day you might misremember whether you properly checked it, rack the slide to check the chamber when you forgot there was a loaded magazine in the gun (thus accidentally chambering a round while trying to clear it), or otherwise screw up in a dangerous or (hopefully) just embarrassing manner.
When first learning to handle and fire a gun, there is a lot of information coming at you fairly quickly. A good instructor will try to keep that down to a minimum at any given moment to mitigate confusion, of course. Even so it can be overwhelming, particularly because of the dire importance of some of the information when dealing with anything that has potential to end in such significant tragedy. This applies every bit as much to cars, power tools, and gas appliances as it does to firearms, though firearms have the added benefit of the rules for how to avoid tragedy being much more straightforward to learn. To help with the process, apply these important principles when learning about firearms:
BE HUMBLE! Safety is far more important than your ego. Always admit mistakes, always listen to a competent expert trying to teach you something
*, and so on.
BE SAFE! It is better to forget a simple piece of technical knowledge ten times, and have to ask to repeat it ten times, than to forget to check your background once when firing at a target. Even if it means forgetting everything else you learned, remembering everything about firearm safety is the top priority, with no exceptions.
* = While I am not a fan of the word "mansplaining", I understand the honest intent that sometimes lurks behind the use of the word. Some people are condescending toward others and try to hold their sense of superiority over others by over-explaining something (and all too often even getting it wrong). When it comes to a competent expert in firearms talking to a relative novice, though, it's typically best to assume there is no such thing as "mansplaining". Listen to what the person has to say, humbly evaluate it, and learn from it if you can. I don't care if it's the ninetieth time you've heard that you shouldn't look down the muzzle of a gun; just listen to the person telling you to never look down the muzzle of a gun. Some day, if you snap at someone every time that person explains something you already know, the explanation the person doesn't give you for fear of your reprimands might be the lesson you haven't fully internalized and could save your life. If you are some kind of narcissist who simply cannot be entirely humble, at least signal your own competence in an affirming manner, with words like "of course" without any snark in your voice. You can play dominance games in other ways, later, when and where lives don't depend on it.