The below steps are assuming you have a Mac machine with adb and fastboot tools installed and developer option and usb debugging is enabled on your Pixel 2.
The below steps can also be used to revert to Android Oreo or Android pie from a rooted phone.
Unlock bootloader
- In developer options on device, enable “EOM unlocking” (allow the bootloader to be unlocked)
- adb reboot bootloader
- fastboot flashing unlock (unlock/lock will reset phone and wipe data)