Does your iPhone X battery drain faster than normal?
Does it turn off before it fully drains?
Perhaps your iPhone X dies or resets randomly?
Are you having other issues related to your battery?
These are all signs of your battery failing and a replacement is your answer. A new battery for your iPhone X should fix most of these issues.