Before you remove your personal information, be sure to back up your device and remove your Google account from the phone. Once you’re ready to part with the phone, you can reset it to factory reset. This will remove all data from the phone.
Open your phone’s Settings app. Go to System > Reset options > Erase all date (factory reset). Select Erase all data to complete the reset. You may be prompted to enter your PIN and select Erase all data again.
The phone will restart, and after that, it will be reset to factory settings.
You can read more about resetting your Pixel phone here: https://support.google.com/pixelphone/answer/4596836?hl=en