Updating the controller regularly can also prevent and fix the drift.
1. Head to Settings > Accessories > Controllers and select Wireless Controller Device Software.
2. Connect your DualSense controller via a USB-C cable to your PlayStation 5.
3. You will be prompted to update the firmware on your controller.