So I'm attempting to replace an old light fixture with a new one I got from home depot. The light fixture is at the top of a stairway, there is a switch at the bottom of the stairs as well as the top of the stairs that control the light. Going into the overhead box there are 3 pairs of black/white/ground wires. Only on black wire is hot, every other wire has no voltage. Between the two switches are a set of black/white/red/ground wires. The circuit that the light is on also goes to a small bathroom upstairs as well as a bedroom. How should I proceed wiring this? I'll attach a few pictures to this to hopefully better clarify what i'm looking at.
New junction box, eh? First, reinstall all cables in the junction box.
That trick with the ground wire wrapped around the sheath appears to be using the cable clamp to ground to the metal box. Note the metal box will have a #10-32 tapped hole intended for a ground screw, and you can put a pigtail on that to ground anything else.
Now, identify which cable goes to the switch. Mark its white wire with black tape, and its black wire with red tape.
Also mark the black wire from the new lamp with red tape.
Now you join similar colors: red to red, black to black, white to white, bare/green to bare/green.
You do not want to disconnect any wires except the two that go to the old light fixture, and the ground if there is one. Please tell me you didn't disconnect all the wires up there. Take the white from the fixture and hook it to the white from the overhead box. Take the black from the fixture and connect it to the black from the overhead box. If there is a ground connect that back up. You should be good to go..... unless you mixed them all up..