Based on your description, the likely configuration is:
- incoming power -> switch -> light 1 -> light 2 -> light 3
That would put two sets of wires on light 1 (switch & light 2) and light 2 (light 1 & light 3) but only one on light 3. If that's the case, then all blacks (switched hot), all whites (neutral) together at each of the lights would be correct, and any one light not installed (or bulb burnt out or whatever) would have no effect on the other lights. So that leaves the switch.
Based on the pictures:
- Your wires are coming in via cables rather than conduit.
- There is a Big Bundle o' Neutrals and a Big Bundle o' Grounds. Those are perfectly fine, and since you are using (for now anyway) ordinary "dumb" switches, leave those "as is".
Assuming all wires (except ground) are black and white, the way to wire it is:
- Unless you are already 100% sure, determine which of the incoming cables is incoming power vs. switched to light:
- Turn off the breaker
- Disconnect all wires to the switch and make sure all ends are separated
- Turn the breaker on
- Use a non-contact tester to determine which of the black wires is hot.
Do not continue unless you have identified exactly one hot wire.
You now know which black is hot. The matching white is neutral (should already be in the Big Bundle o' Neutrals). The other black is switched hot. The other white is also neutral (should already be in the Big Bundle o' Neutrals).
Turn the breaker off again and then:
Connect the hot wire to one screw on the switch (if it is a simple switch then it doesn't matter which screw, if it is a smart switch then this is "hot" or "line")
Connect the switched hot wire to the other screw on the switch (if it is a simple switch then there will only be 2 screws, if it is a smart switch then this is "switched hot" or "load")
If this is a simple switch, connect the two white wires (neutral) together with a wire nut. Unless you took apart the Big Bundle o' Neutrals (which would be a bad thing to do), this is already done.
If this is a smart switch then use a pigtail (there may be one already as part of the switch, if not then make one) to connect the two white neutrals together with a pigtail from the neutral connection on the switch.
Turn on the breaker and test.
If things still don't work right, you need to (carefully) check the power. Use the non-contact tester to see if power flows to the switched hot when you flip the switch. If it does not, then you have a switch problem. If it does, then check for power at Light 1. You may need to (with the breaker off) take apart the groups of black & white wires at Light 1 (and 2 and 3, but do one at a time) to figure out where each cable goes.