There are two types of under-cabinet lighting: plug-in and hard-wired. Hard-wired lighting fixtures are more attractive. An easy way to hard-wire under-cabinet lighting fixtures requires tapping into the power of a nearby receptacle by running a cable to a newly installed switch box and pulling the cable to the location of each fixture.
Decide where to run the cable
Aim to minimize the disturbance of the backsplash and the wall. Cut a channel just above the countertop's back by removing the backsplash, and drill holes in the wall studs for pulling the cable. If the backspalsh is non-removable, directly drill holes in the wall studs.
Run the cable
Position the cable high enough to ensure that it comes out inside the cabinet. If it comes out underneath the cabinet, tighten the hole as much as possible to ensure that the fixture can hide it. Keep 16 to 18 inches of cable coming out on each end for making connections.
Wire the fixture
Expose the individual wires of the cable by stripping off the sheathing. Put the cable through the knockout holes in the body of the light fixture, and use cable clamps to secure it. Ensure that the clamp is on the sheathing. Screw the fixture in its desired position. Connect the wires from the fixture with the like-colored individual wires of the cable.
Install the switch
A remodeler's box is ideal for the switch. Turn off the power. Cut a hole for the switch in the wall. Wire the switch. Turn on the power, and test the system.