How should I connect my new ceiling light to this wiring?
It looks like you have a switch leg possibly improperly wired and possibly 2 lights or a light and power going someplace else like an outlet (possibly a spare)  You will need to figure out which one is the switch then it will be easy, your main is labeled.
When you find the switch cable it is probably the one with black tape on the white wire swap that black and white so the white is always hot and the black is now the switched hot.  Then the light fixture can be hooked up to the black switches hot and the white from the main. If everything works the other cable may be a spare, if you find another outlet or light that doesn’t work the one that is not connected needs to be connected to the Main cable white and black. It would be good to put a wirenut or crimp sleeve on the grounds and attach them to the box as it is a metal box the ground should be connected to the box , this may also be done with the new fixture green wire.