If there are sparks, then it is probably a brushed motor with the brushes rubbing on to the commutator. Sparks will occur when the contact is not good such as when the brushes are worn out. Worn brushes can be replaced They can also occur when the armature is damaged and there are large voltages between commutator segments. In this case the motor is dead. Check that there is no sparking damage between two adjacent segments.