Most massage guns use a lithium-ion pack, and the failure mode is nearly always the battery rather than the motor.
Avoid storing it flat
If the gun will sit unused for weeks, leave it around half charged rather than empty. A pack left fully discharged for months often will not come back.
Charge at room temperature
Charging a hot gun straight after a session shortens pack life. Give it a few minutes to cool first.
Unplug when full
Most modern units handle this themselves, but leaving any device on charge continuously for days is a habit worth breaking.