The motor sprocket is attached with a 3mm roll pin that needs to be punched or pressed out of the sprocket and motor shaft to remove the sprocket. Then a new 3mm roll pin in hammered or pressed into the new sprocket to install it.
The rear wheel sprocket is threaded onto the wheel hub with clockwise threads so it needs to be unthreaded from the hub in the counterclockwise (left hand) direction. Unthreading the sprocket can be difficult because it gets threaded onto the hub tighter and tighter everything that the scooter is used. We recommend to lay the wheel flat on its side and soak the threads overnight with penetrating oil to help loosen them if the sprocket can not be unthreaded without doing so. Also anything that you can do to create mechanical advantage to help loosing the sprocket's threads is recommended. Tapping on one of the sprocket's spokes with a hammer can help to loosen the threads, and using a homemade cheater bar made from a two or three foot section of 2x4 and two large bolts that catch two of the openings in the sprocket can also help to remove it.