Wiring a Switch and Outlet the Safe and Easy Way
Research the Task

"The first thing any homeowner needs to know is if they are not comfortable or do not know what they are doing when it comes to working with electricity in any way, hire a professional," says Joe Hammer, owner of SAK Plumbing & Electrical of Phoenix, Arizona. "Working with electricity is completely different than fixing a leaky pipe or squeaky door."
That's true, but Williamson says you got this: "Replacing switches and receptacles is still very much something that a DIYer can do!" Before you jump in, do your research. Figure out if learning how to wire a light or receptacle is something you want to tackle. "The internet is indispensable, especially YouTube," Williamson says. "I do it all the time."
Test Every Circuit

Before you start digging around in any switch or receptacle outlet, "test, test and test again," Williamson says.
Use your non-contact voltage tester, first verifying that it works by testing it on a known live circuit. Carefully remove cover plates and devices, and don't grab switches or receptacles by the terminal screws, at least until you know the circuit's off. Check every wire and connection with the tester to make absolutely sure they're de-energized. Once you've verified all circuits are dead, test the tester again on a live circuit to ensure it didn't malfunction.
Pack Boxes Neatly

Electrical boxes have limited space to begin with, and the device and conductors take up a lot of space. "For new work, I install the biggest box possible," Williamson says. I spare no expense. The extra cost of a larger box is a tiny percentage of the overall cost of the electrical materials for the project."
But unless you're roughing in a new addition, you may not have the luxury of a nice big box. You're stuck with what the electrician added originally, when devices used to be a lot smaller. Use pigtails sparingly, and once you've made a connection, fold the wires neatly and push them to the back of the box. Keeping wires and connections neat and orderly is safer, and will cause fewer headaches for you and future homeowners.
Identify All Wires

The non-sheathed cable used in many residential settings is commonly called Romex, a popular brand of cable assembly. "Each wire has a different purpose in a Romex cable," Hammer says. For 120-volt household circuits, the black wire is the hot, and the white wire is the grounded conductor, aka neutral. On a 240-volt circuit, like the one feeding your electric dryer, you'll have two hots, one black and one red.
It's common to have more than one circuit in any given electrical box, so it's a great idea to label or otherwise identify your wires. Use a marker and electrical tape, painter's tape or twist wires together in a way you can recognize. If you don't, "once the drywall is installed and the wiring is hidden from view, maybe weeks or months later, it can be a nightmare," Williamson says.
Label Your Breakers

Labeling your wires is only part of organizing your electrical system. If you had to do a lot of legwork tracking down the circuit you wanted to work on, now's the time to fix that. Find out what each breaker controls, and take the time to label your breakers. "This could be a color system, [or] a piece of tape next to the switch on the breaker" with descriptions of each corresponding room written on it, Hammer says.
When it comes to electrical safety, knowing how to wire a light switch or receptacle is only part of doing responsible DIY electrical work. Grab some tape and a magic marker, and take 20 minutes to investigate and label your circuits. Keeping your panel organized will help you and future residents be safe and secure.