You can check the health of your iPhone's battery to determine when it's time for a replacement.
I've been using my iPhone 12 Pro Max for just over three years, and it's still a great device for my needs. But after that ...