My brother changed the passcode on his device and it glitched out or something and he has no access to it at all, what can he do?
You need to perform a factory reset that will clear everything stored in the phone memory, unfortunately.
If you previously enabled USB Debugging in the Developer Options, there is a way to remove or reset the lock screen. No data is lost here.
On some Samsung device, you can reset the lock code with AT commands when the device on Download mode (Never tried myself though). Some paid softwares can do the job just on one click. z3x, Miracle Box, etc
If the phone's rooted you can try adb. But for Adb you should need the adb debugging option enabled on the phone. write those commands in adb shell of your pc.
adb devices adb shell cd data/system su rm *.key
OR On TWRP Mount the system,use file manager,navigate to data/system remove all files ending with .key
Done.You got your phone unlocked.