what should i do?
Check the Maximum Capacity of your battery.
Settings > Battery > Battery Health & Charging > Maximum Capacity
What is it? Anything near 80% and the battery needs to be replaced at the Apple Store or an authorized Apple Service shop. The shop might also find other issues that will need to be addressed.
If the Maximum Capacity is 85% or higher, the battery is starting to run out of steam, but there may be other issues with the phone that will need attention at the Apple Store or authorized Apple service shop.
Genius Bar Reservation and Apple Support Options - Apple
If required repairs are extensive......and expensive......as they may be......the money might be better spent on a new phone. The iPhone X cannot run iOS 17 or iOS 18, so you are falling significantly behind. And, it appears as if there will be no more security updates for iOS 16, which is what your iPhone X is running.
But, your call on that.