Chosen Solution

nexus5 is restarting again and again , i did factory reset, still dont work. i think its the problem with power button being stuck or something

This is a common problem, had the exact issue with my nexus 5. What I found worked was tapping the home button against the table and over time whatever was causing it to stick went away and hasn’t had issues with the power button ever since.