Electrical – How should connect the light to the wires in these three cables

electricalwiring

My house was built in 80s. I have a light fixture I want to mount with live (black)and neutral (white) and ground. Question is the two white wires bundled are neutral. The other 4 are confusing. 3 of the others have paint markings indicating they are hot and one black wire with no paint. I wired it wrong cause the light turns on but at the switch won’t turn off

enter image description here

Best Answer

You probably have a standard switch loop and a cable that goes out to another part of the circuit.

It's basically this with an extra cable coming in, which would simply be connected by color to the supply cable wires.

enter image description here

You'll have to do some sleuthing with your multi-meter to see what's what.