This diagram illustrates the wiring for a bedside lamp with two sockets. The top socket A, holds a standard incandescent bulb. The second socket B, typically holds a small, low-wattage bulb similar to a night light bulb. The switch allows for energizing the top bulb only, the night light only, both bulbs at once or for turning both bulbs off.
The plain wire is the hot. If the cord isn’t marked with a bead then the strands of wire will be different colors. In these cases the silver wire is the neutral and the brass colored wire is the hot. The plug on the lamp cord holds another clue to polarity with the wide prong being the neutral and the narrow one the hot. Older lamp cord will have prongs that are the same size. This is because polarity was not observed on electric lamps until the development of grounded circuits.
This is an updated diagram for the same circuit. Here the source neutral, known as a grounded neutral, is run through to the switch box where it can be used to power switches that require a neutral connection. A neutral connection like this is now required in most new switch boxes as of the code changes in 2011.
Back at the source, the white neutral wire is spliced to the white from the fixture cable and to a pigtail, back to the receptacle neutral terminal. At the fixture the white connects to the neutral terminal on the light. The hot terminal on the light is connected to the red wire from the switch loop cable and the other end is connected to the top terminal on the switch.