If your controller is still under warranty, your best bet is to contact Microsoft Support for Xbox and try to either have it replaced or repaired. Alternatively, you can contact the store where you bought it and report that it’s malfunctioning. Oftentimes, you may not even have to speak to Microsoft in order to get this issue resolved. Unfortunately, if your controller is already a couple of years old and the warranty has expired, your options are more limited.
You can still contact Microsoft and hopefully get the controller repaired for a fee. This will often involve shipping the controller and waiting for it to get back to you, though, so your gaming will be put on hold while your controller is sent away. There is no telling how long it might take for the Xbox technicians to repair the drift. With that said, it’s a fairly easy fix for a professional in possession of all the required tools, so it might not be that long.
If you want to forego the hassle of having to pay and wait for repairs, you could buy a new Xbox controller. Wired options are usually around $30 to $40 and, and unlike with repairs, a new, working controller will arrive at your home in the next day or so. You could expect to spend about $60 for a new wireless Xbox controller. Of course, replacing controllers is a last resort.