With so many enemies on the screen at once in Kingdom Hearts 3 it’s helpful to focus on just one enemy while fighting. You can do this in Kingdom Hearts 3 by using the lock-on feature where you can target a specific enemy.
By default, Sora will attack the enemy that is visible and closest to him on the screen. However, if you press the RB Button (Xbox One) / R1 Button (PlayStation 4) you will lock-on to an enemy. Once you are locked on to an enemy you can then press the RT (Xbox One)/ R2 (PlayStation 4) to cycle through other targets on the screen.
When fighting without locking on you will notice that the enemy you are going to attack will have a yellow target marker on it. Once you press the RB button that marker will turn from yellow to blue. The blue marker designates that you are locked on to that target.
You do not need to hold the RB/R1 button to stay locked on to an enemy. Sora will remain targeting that enemy until they are defeated. Once they are defeated though you will need to press the RB/R1 button again to lock on to a different enemy.