Download Pie from
Google | Factory Images for Nexus and Pixel Devices. (Assuming a Google device.) Remove the -w in the last fastboot line in the .bat or .sh file you'll be running, then flash the phone. (The bootloader has to be unlocked. If it's not, and you have to unlock it, back everything up first, because unlocking the bootloader wipes the phone.)
If you get stuck in a situation where you're in the bootloader and the PC won't recognize the phone, hold the phone's power button in until the phone vibrates (you'll see the bootloader screen flashing on and off until it does.) Then the PC should recognize the phone. Issue
fastboot boot boot.img
(Pull the boot.img file out of the download, which you had to unzip to begin with. The boot.img file is in the imagexxx.zip file.)
That should bring you back to Android, but you still have to replace the corrupted boot image. Issue the command
adb reboot bootloader
Then, once you're in the bootloader, issue
fastboot flash boot boot.img
and you'll be in business. Restart and you'll be in Pie.