Chosen Solution

I changed the battery but still, iPhone does not work what causes it?

Have you made sure you have connected all of the required ones, like the battery, screen, earpiece and digitizer? Make sure they are pressed all the way down gently if you need to. This is what happened with my iPhone XR.

It might be the Charging Port assembly piece. The Ifixit Store has them for a good price. iPhone 5 Lightning Connector and Headphone Jack