A cable with red, black and earth
Another cable with red, black and earth
These two cables will be the supply in, and the other will be the feed out to the next lamp. You can tell, by turning off the power at the consumer unit, separating the wires, then turning the power back on, setting the tester to AC Volts high, and seeing if there is a 230v (approx) voltage across the Red and the Black of each cable. If there is voltage, it is the supply in. If not, it is the supply out. When you have identified these two cables, turn the power back off at the consumer unit, put the two reds in one terminal; the two blacks in another terminal, and the earths in the earth terminal.
A cable with red, red and earth
This will be the Switch cable. If you set your tester to continuity, you will find that continuity exists with the switch "On" and no continuity with the switch "off". When you have identified and marked this cable, put one of the red cores with the other two in the same terminal mentioned above. Put the other in a terminal of its own, marked "switched live"
A cable with just one black and earth
This is probably a borrowed neutral. Leave it disconnected fdor the moment. When you restore power you will probably find that something has stopped working, probably a landing light. When you have found out what it does, mark it "borrowed neutral to landing light )or whatever) and then put it in the terminal with the other two blacks, and check that the landing light now works.
When you have done all this (with the power off!) connect the wires from your light bulb holder to the terminal with all the blacks in it, and the brown or red one to the terminal with just the switched live in it. Turn the power back on, stand back, and check that the switch now turns the light on and off.