Electrical Questions? Ask an Electrician Online.
Welcome to justanswer.com
Would it be possible to send a picture of the box the fixture mounts to and of the connections on the fixture?
Also, is there another light that is on the same switch?
Do you have a multimeter or test light?
If so, turn on the light switch that you want to control this light and find the hot wire in the box and let me know which one it is.
OK, with wiring like this it appears that the black and the red wires are on different switches.
Without a meter it will be trial & error (or hopefully no error).
Connect the red wire to the fixture. Connect both whites and a 6 inch pigtail under a wire nut then connect the other end of the white pigtail to the fixture. With another wire nut connect both blacks together. Connect the bare ground to the green screw on the fixture. When you get to the point you can test it before you mount the fixture and let me know if it works properly.
Yes, twist together, cut one off, connect the remaining single wire to ground