That's why a factory reset is crucial before you sell, recycle, or donate your Android phone or tablet. It can also be a last-ditch attempt at troubleshooting persistent issues with your device.
If your tablet is a Samsung device, you can use Samsung's Find My Mobile service to reset the login credentials from there.