Be careful because some of those reds could be negative and some of those blacks could be live. DO NOT put them all together.
What you have there is in essence a junction box. You'll notice that some of the wires are thicker than others, those thick ones are the ring main, the thinner ones are heading off to the light switch or a spur.
Do you have a voltmeter? You'll need one, nip down to B&Q sharpish and get one, about a tenner. The following is about right and saves me a load of typing.
Quote:
You actually have six L wires and two N wires and the 3 grounds. The two wires from the switch are both L legs, and it is common not to identify the white wire to the switch as a hot leg, but it is a hot leg, so you have two hot legs to the switch, one from the second light, and the circuit hot leg. You can separate all nine wires and use a multimeter or volt tester with the circuit hot after separating the wire and be sure they are not touching anything, and locate the hot circuit. With the wires separated, if using a volt tester, only the black wire will set off the tester, you can then see the neutral wire connected in the same cable with the hot wire to identify the circuit neutral. After indentifying the hot circuit, mark these and we will work with the other two sets of wires. Turn the circuit back off, and with the switch off, see which pair of black and white wires do not have continuity by using the ohm scale and touching one lead to a white, and the other to a black. When there is no reading between these two, that will be the switch circuit. Turn the switch on and do the same two wires again and there will be continuity verifying the switch circuit. By process of elimination, the other set will be from the second light. Now that all are identified, connect the white wire of the circuit to the whites of both lights, and connect all of the grounds together. Now connect the hot circuit black to the black going to the switch. The white from the switch needs to have black tape on it to identify it as a hot leg and connect it to the blacks of both lights. Now the switch will control the lights.