assuming the phone is more than 1 year old... it is time to get the battery replaced.
nexus 5x also has bootloop problem right? so my suggestion would be to sell the phone as soon as possible and get a new phone. or you would end up with a dead phone which would not even fetch 5-6K rupees that 5x might fetch you today just like me.
Boot loop issue got solved as LG replaced the mobile free of cost, now if battery problem stays I might get new battery, as new pixel 2 is still too expensive and I prefer pure google phone ( OS), under 20k. It's just gonna do 2 yrs this June.