So your box has only 3 cables. That means it's most likely wired up like this
- Incoming cable from the previous fixture or circuit breaker
- Outgoing cable to the next fixture
- Cable to the light switch (looks like this might be the blue cable)
It looks like you nutted the wires all together. So somewhere in there you have a hot and a switched hot. When you flip your switch, you're creating a bridge between the hot and neutral, and thus your circuit breaker trips because you hit that max amperage instantly.
The good news here is that you can see the cables and where they go. What you need to do is follow the cables and label them. Then we're going to modify the box as such
- Connect all the bare ground wires together and nut them off. Add your fixture ground into this.
- Connect the incoming and outgoing white wires together with the white wire from your fixture and nut them off (very important the white wire to your switch is not in here)
- Connect the incoming and outgoing black wires AND the white wire from your switch. Use a black sharpie to mark that white wire so it's clear that it is a hot wire. Nut them off
- Connect the black wire from your switch (last wire left) to your fixture's black wire. Nut them off.
This will correct the problem of your breaker popping when you flip the switch