Even on the Switch 2, the drift problem (character or cursor moving on its own) can occur, just like with the first Joy-Cons.
Causes: wear of the potentiometer in the analog stick, dust, or a factory defect.
What you can do:
Stick calibration: Settings → Controllers and Sensors → Calibrate Control Sticks. Sometimes helps partially.
Stick cleaning: carefully lift the rubber cap and apply isopropyl alcohol or contact cleaner spray.
Controller reset through the Switch menu.
If this doesn’t help — replace the stick. Repair kits are available, but it’s better to contact an authorized service center.
In some countries, Nintendo officially repairs Joy-Con drift for free, even outside of warranty — check with support.
Related Complaints
Delayed and Overpriced Repair for Nintendo Switch OLED

I submitted my Nintendo Switch OLED for button repair on December 7, 2023, but didn't receive a repair quote until December 26, 2023. Initially, I was told that the spare parts were available by the end of the first week and that I would receive the quote at the beginning of the following week. For ...