I got "Your device is corrupt. It can't be trusted and may not work properly" on a brand new Nexus 5X. What should I do?
Unlocked bootloader = yellow triangle warning; modified system/kernel = red triangle warning.

As long as the device functions fine you shouldn't worry much; however if restoring is what you need, then flash a factory image then relock bootloader. Do turn on "OEM unlocking" in Developer options after that, so that you have a chance to recover in case anything happens.