Chosen Solution

this problem started two days ago it shuts off at 22% and them opens shows it is 10% and then shuts off again what should i do

Lets start with the battery. Was it ever replaced? Go into settings, battery, battery health, and tell us what it says in Maximum Capacity. If it’s below 85% or shows service battery, then you’ll need to get it replaced. You can purchase a kit here on ifixit or bring it to a local independent shop and they can do it for you.

It’s 83% and it doesn’t say service, will it help if I DFU restore my phone?