Tesla batteries, including the battery in the Model X, can be upgraded via software updates to last longer. If that still doesn’t offer enough juice, you have to purchase a new battery.
Keep in mind that, like everything else related to Tesla ownership, purchasing an upgraded Tesla battery is not a cheap endeavor. The most basic Tesla battery costs between $13,000 and $14,000. Thus, it might be more cost-effective to simply trade in your Model X for a newer version.