Welcome to Android Central! I agree that the battery has probably died. Another possibility is the motherboard failed -- the Nexus 5X was made by LG around the time of all of their problems with the G3 and G4, so motherboard failures happened with the 5X as well.
If you need data on that phone that you didn't backup or sync anywhere, then you'll have to bring it to a repair shop and hope that replacing the battery is all you need. (Replacing the motherboard will also wipe your data.)