Diagnosis
Dust, sawdust, or spilled liquid has infiltrated the trigger assembly and is interfering with the variable-speed potentiometer or the physical slide.
How to Fix It
With the battery removed, work the trigger back and forth rapidly dozens of times. Then, spray electronic contact cleaner (like CRC QD) into the seams around the trigger. Work the trigger again to disperse the cleaner and dissolve gunk. Let it dry completely.
If That Didn't Work
The trigger's potentiometer, which controls speed, has failed. This is a sealed electronic component soldered to the control board. The entire switch/controller assembly must be replaced as a unit.
Heads Up
Never use WD-40 or household oil. These attract more dust and can degrade plastics. Use only cleaner designed for electrical contacts.