If your iPhone is under warranty and the battery power is less than 90%, you can try the following methods to solve the problem.
Check the battery health.
First, go to Settings-Battery-Battery Health and check the maximum capacity and peak performance of the battery. If the maximum capacity is less than 90%, the battery has been damaged and needs to be replaced.
Replace the battery
If your iPhone is under warranty, you can replace the battery for free. You can go to Apple's official authorized maintenance point or make an appointment for maintenance service through Apple official website. If your iPhone is not under warranty, you can choose to replace the battery yourself or go to a third-party repair shop to replace the battery.
Optimize battery use
In addition to replacing the battery, you can also extend the battery life by optimizing the battery use. For example, turn off unnecessary functions, reduce screen brightness, and turn off background applications.
If the battery capacity of your iPhone is less than 90% during the warranty period, you can solve the problem by replacing the battery. If your iPhone is not under warranty, you can try to optimize the battery use or go to a third-party repair shop to replace the battery.