* Make sure the battery is fully charged
* Check if the charger is working properly
* Check for the moisture on the phone
* Boot the Nexus 5/5x in Recovery mode(Worked for me)
* Go to the authorized repair store to fix the hardware issue
Source : [link|https://fixyourandroid.com/fix/how-to-fix-nexus-5x-wont-turn-on/|https://fixyourandroid.com/fix/how-to-fix-nexus-5x-wont-turn-on/]