. This is what I'm looking at I'm just lost as what to connect to what
First, we do not do splicing in open space like this. All these cables need to terminate in a proper junction box, with cable clamps attaching the cable to the junction box, clamping the undamaged full cable, not individual wires. If you can't find a junction box big enough, get two or more steel junction boxes and an EMT nipple or short length of EMT conduit with adapters to connect them. One of these boxes can be the lamp junction box itself. The lamp must also attach to a junction box embedded in the ceiling.
Here's what I see. I could be wrong.
There are three Romex cables running through the area, but with no connections. They have nothing to do with it and can be forgotten about.
The top and left cables go to 3-way switches. Any system of 3-way switches has two wires which are travelers. The travelers are interchangeable. The travelers can be any colors, but in these two cables, they are red and black in both cables. I would run, not walk, to the nearest home improvement store and get a 5-pack of colored electrical tape, and mark all 4 of those wires with yellow tape, to designate them as travelers. You won't be dealing with them again.
The ground wires are ground wires. They all go together and done.
From here we have two possibilities.
Single lamp, power provided here.
In this scenario the right cable is the power supply.
The flopping around loose white wire from the left cable is actually switched-hot. My preference is to mark switched-hot wires with red tape. This goes to the lamp hot wire (black or brown).
The flopping around white wire coming from the right cable is the actual neutral. Lamp neutral (white or light blue) goes there.
Dual lamps, power from leftside switch.
In this scenario the right cable goes to another lamp controlled with this one.
There should be a bundle of actual neutral wires. Thing is, all the wires in this bundle will be white. You see 2 loose white wires, and of course the white from the lamp itself. Those had been a bundle, but were disassembled. They all go together in the neutral bundle.
Now the only wires we haven't accounted for are the white from the top cable and the black from the right cable. I assume that bundle is switched-hot and the right cable heads off to another light. I prefer to mark these with red tape. Attach your lamp's hot wire to this bundle.