90% of AMX motor issues can be fixed using the 2 steps below, so its possible there is an immediate fix to your issue. The motor connector is a complex connector, performing multiple functions from high power input, to correct phase communication with the motor. As such, it is essential that it is connected correctly and free from dirt.
The motor cable is located on the rear chain-stay. First ensure the bike and battery are off, then check if the motor cable is fully seated.
See the gif below, the two arrows should meet at the engraved line. It is a waterproof connector and must be pressed together with some force

Additionally, check for any damage to the motor cable (see below). This is caused by rubbing the tyre during motion and can be prevented by ensuring the motor cable is correctly secured away from the rear tyre.

If you've checked that the motor cable is correctly connected. It is possible that some dirt has got into the connector.
<aside> ⚠️ Warning: First ensure the bike and battery are off, then disconnect the motor cable.
</aside>
It can then be cleaned using an anti-corrosion cleaner. We love Deoxit (red).

Apply the deoxit liberally to the male and female side of the connector. Then reconnect the connecter firmly as in step 1. Turn on the bike and your motor issue should be resolved.