What can I do if I forget my passcode to my device (Samsung Galaxy Tab E(2017))? 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. 

Edit:

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