When something that was out of your control goes wrong with your phone, the typical process involves making sure your warranty is still active and either getting it repaired or having a replacement ...
My wife got a replacement Nexus 5x due to this issue a week or so back. Quick and relatively painless. We did have to buy a burner phone for her to use for a few days as it, of course, started to fail ...