1. First of all, make sure your Bootloader is unlocked. Check back with your device manufacturer on how to do that.
  2. Make sure you have adb and fastboot installed.
  3. Download the latest GSI and unpack it if needed.
  4. Use fastboot flash system image.img (replace image.img with the proper image you’d like to flash)
  5. Wipe the cache and userdata partitions using stock recovery when possible
  6. reboot
  7. Make sure you set up your device as ‘new device’ without restoring backups as you will run into problems if you do.