In iPad Settings, go to General, then Transfer or Reset, then "Erase All Contents and Settings". The next thing you see ( after confirmation) is the welcome screen as if just out of the box.
Also: If shipping it you might want to power off by holding top and bottom buttons until you see the "slide to power off" slider. I recently sold my iPad 2, cleared it to factory settings as described and powered off. Happy new owner received it with charge, ready to configure.
If FindMy is enabled, you must disable this first [meaning you must have access to its iCloud account] or the new owner will not be able to use it, it will still be locked to you.