The steps required to replace a speed controller are very similar across all NANROBOT scooter models. This video shows the process on a D6+, though it is nearly identical to the steps taken on a D4+2.0:
The key difference in replacing a D4+ 2.0 speed controller vs. a D6+ speed controller is the number and arrangement of wires. Each speed controller across each scooter model is tailored custom for that scooter. Each speed controller will be marked with an "A" or a "B" in the top right corner of the label. The "A" controller is for the front motor, while the "B" controller is for the rear motor.
If you observe any extra, black and red wires coming from either controller that aren't connected initially, don't worry, as these are optional plugs for extra lighting.
Although a different strategy is used in the video, a pro method of changing the controllers is to only disconnect one wire at a time, transferring the connection onto the new controller immediately. Having only one wire disconnected at a time will reduce the chance of confusing the different connections. I highly recommend using some sort of masking tape as a label, as it is easy to get lost in the labyrinth of wires.