I'd certainly think very hard about taking the money you'd spend on a battery and put it towards a newer much better phone with a bigger/better battery. The battery wasn't great in the X when new and degraded pretty quickly, its pretty small. That was the worst thing about the X. If you look into doing that, wait until after the 13 hits the streets, prices will drop quite a bit from where they are now.
Heat is teh biggest thing, use your phone on battery saver mode, that helps, try to not charge above 80 especially 90%, certainly dont leave it on the charger long/use the smart charging feature. Try not to charge it fast unless you specifically want it charged faster, but if you're only charging to 80% or so it may not be that big of a deal. It may be nothing, but I feel like I've noticed the people with the best battery % after a year or two were people that charged wirelessly. No idea why.
I had read someone who talked to a apple battery engineer and said when you plug in it starts a chemical reaction in the battery that wears the battery down/only has so many of those in the life of the battery, so dont be constantly plugging in for short little amounts, leave it on longer. I havent seen anyone say this other than that, and that was several years ago. I know batteries are rated for a certain number of cycles (0-100%) so idk if this is something or not.
Dont let it get too low either. Ideally you want to stay between 20-80% probably. Dont let it sit below or above these for too long. The smaller the battery, the harder that is to do.
Hope this helps.