Our den has a switch that does not seem to operate anything in house. There’s not a ceiling light in room and it does not affect the four outlets in the room. It runs from a 15 A circuit in the breaker box. I decided to remove the switch and use the wire to power six can lights I installed in the ceiling. They are smart lights and I have a smart switch to operate them. I hooked one of the can lights to the wires connecting black to black, white to white, ground to ground but nothing happens. I used a non-contact volt meter on the wires and both wires turned it red. Not sure what to do from here?
That's a switch loop. Bog standard. Perfectly legit until recently. The white should be unswitched hot, and the white should have marking of tape, paint or heat-shrink in a hot color (but often does not.)
You need to find the box that the switch loop comes from, where you will find its white connected to a black, and where there is normally also a white neutral.
Color does NOT imply function in cables. Color may guide you, but not all whites are neutrals.
And in that socket Ecnerwal mentioned... you will find that somebody replaced the receptacle, probably for aesthetic reasons or to get a USB recep... and they did not know what they were doing, and they did not notice that the "tab was broken off" on the original recep.
They did not break it off on the new recep.
As a result, they "shorted out" the switch, making both sides of the switch hot at all times, just as you are measuring.
Once you identify the socket Ecnerwal describes by the other wires in the box (e.g. a white wire with blacks)... go ahead and snap the tab off between the brass screws. Voilà, the switch will start working again.
Turn off the circuit breaker and verify power is off before opening any box.
Also, while you're in there, wrap a few loops of black electrical tape around that white wire. It's supposed to be marked to indicate that it's a hot.