Wire Ceiling Light
how-to-wire-it.com/ Wiring a 2-Way Switch
See Basic 2-Way Circuit - Power Coming In At Light
do-it-yourself-help.com Light Switch Wiring Diagrams
diy.stackexchange.com/questions How to properly wire a ceiling light fixture?
Notice the white wire that runs between the switch and the light has a black stripe on it (in above image), that lets anybody that works on this light in the future know that the wire is switched. You can mark the wire using a bit of electrical tape, or a marker.
Figuring out which wires come from the breaker, and which go to the switch will require some tools. First Turn off the breaker, and verify the power is off using a non-contact voltage tester. Now pick one set of wires to work with first (one black and one white from the same cable). Turn the switch to the on position, and use a multimeter to check continuity between the two wires. If the wires are connected (low resistance), these are the switched wires. If not (infinite resistance), check the other set of wires. If neither pair pass the test, contact an electrician.
I’m willing to bet that the line from the breaker goes directly to the fixture, and then there’s a line run to the switch. To test this, get a meter. Unhook the fixture and label the blacks, B1 and B2. Make sure there’s no contact/shorts and turn the breaker on. If I’m right, then one of the blacks should show 120V with ONE of the whites. This would be the line to the breaker. The other pair should show nothing - with the switch both on and off. Label the hot pair. Turn the breaker off. Now, flip the switch on, and do a continuity check on the cold pair. It should show a low resistance with the switch on, and open line with the switch off.
If (and only if) this testing checks out, then you can wire up the light.
Put a piece of red or blue tape on the cold black and cold white to indicate that these go to the switch. Open up the switch and label the other ends with the same colour tape.
Now the coloured white should go to the black terminal of the lamp, and the uncoloured white (back to the breaker) should go to the white terminal of the lamp. Also ground the fixture with a bit of bare copper.
Short instructions: After testing, wire the blacks together, and the two whites to the lamp. Label everything.