Its a bummer when your gaming device has a damaged part. In this case, I had to replace my nintendo 3DS new XL after the thumb stick broken after playing too much of ace combat.
I had purchased the analog stick thumb nintendo new which is still available in Amazon. I will not be surprised if you can source for the similar part from Aliexpress or taobao.
To replace the thumbstick repeat the steps backwards.
This post is generally based on Nintendo 3DS XL 2015 Directional Pad Replacement – iFixit Repair Guide