In the bathroom I am remodeling there is a fan in the ceiling and a light above the sink. The light currently works on the switch shown in the box below. The fan is not currently hooked up to power as the previous owners said the switch went bad. Since the switch was already removed I am not sure how it was wired. The two white wires when I uncap the wire nut and take them apart the light in the bathroom no longer works. The switch has two black wires going into it. I suspect the red/white/black wires in the left part of the picture go to the fan. I believe I need to jump power from the existing switch to the new switch but not 100% sure what to do. Please help
Looks like you have a switch for a ceiling or vanity light and that there was probably a double switch for the fan and its light. If that's the case, here's how it goes. I'd strip everything out and start with fresh ends. There should be no tape involved--just properly-sized nuts. Yellow, red, and/or multi-size tan should do.
- The cable coming in at center appears to be your source. If that's not true, it's almost certainly the other two-wire cable. You'll need to safely investigate this.
- Source black needs two pigtails attached. One goes to the single switch (shown in your photo), and the other goes to your new double switch.
- Black from your ceiling/vanity light goes to the single switch (shown in your photo). Position of the two blacks is not important for this switch.
- Black and red from your fan go to the new double switch. Positions of the two blacks and the red depend on your choice of switch.
- All whites get bundled. No pigtails.
- All grounds get bundled, with pigtails to each switch (assuming modern switches with ground screws or pigtails).
Your situation essentially looks like this, though you'd have an additional wire coming off the timer switch:
Note that currently you have three blacks connected to the single switch, one presumably using the backstab socket. In my recipe I'm substituting a pigtail, which I think is a cleaner arrangement.
My condolences on the hideous hack-job done to your drywall.