I need help with a broken LEGO motor
The easiest solution, provided that motor is still in production, is to contact the LEGO customer service using the "broken part" button, or via telephone directly which might be easier for a part such as a motor.

They'll usually provide a replacement without problem, but be advised that by opening the motor yourself, you probably voided any sort of warranty and may need to pay for a replacement.