Chosen Solution

My phone just went off and it shows the apple logo when I put on charge then it goes off again after some few seconds

If the apple logo goes off immediately after unplugging charging cable then it’s the battery most likely at fault.