Monitor your battery’s health. Go to Settings > Battery and you can see what percentage of your battery’s capacity is available. If it’s below 80%, it might be time to think about replacing the battery.
Check for any signs of damage. If your battery is swollen or bulging, it’s a sign that the battery has gone bad and needs to be replaced.
Check for any abnormal behavior. If your battery drains quickly, or you iPhone suddenly shuts off even when the battery is full, it could be a sign that the battery needs to be replaced.
Replace the battery as soon as possible. The longer you wait, the more likely it is that the battery will fail and cause further damage to your device. You can get a new battery from an Apple Store or an authorized repair shop.