The “factory data reset” option in the Android system settings erases all the content on the device.

Scrub Your Android Tablet Before Handing It Down

Before giving your device to a family member or selling it to someone else, be sure to erase all the content and remove your accounts.

nytimes.com