Wiring new light fixture

Ok, so I bought a new light fixture as we wanted to replace the old one after buying this house. When I removed the old fixture to paint, I didn't take note of how it was wired. Now, 2 weeks later, I've got the new light fixture and I can't get it to work.

The box has 2 sets of wires coming in to it. One with a black and white (white has black tape on it) and another with a black and white (no black tape). So I've got 4 wires and I don't fully understand how they should be connected. I've looked at multiple videos and reddit threads and nothing seems to work.

I've tried black attached to black, with white (black tape) attached to black (fixture) and white (no tape) attached to white (fixture). I'm pretty sure the 2 black wires were attached when I removed the previous fixture, but not fully sure.

I've also tried attaching the white (with tape) to the black on the opposite wire set, then attached the black (on same wire set as white with tape) to the black (fixture), and remaining white to the white (fixture)

None of these worked. So finally I tried attaching all 3 blacks together in one, and all 3 whites together in one. This actually turned the light on (the only time this happend) but the switch did nothing. Just on constantly.

I have no idea what else to try other then call a professional. I've installed lots of light fixtures and I've never had this much trouble.

Just a disclaimer; I am, of course, ensuring the breaker is shut off to the box for safety with every attempt. But does anyone know what I'm missing here?