Short answer. Bafang error codes appear on the display as three digit numbers starting with a zero. Common codes: 021 (current abnormality), 022 (throttle abnormality), 025 (brake abnormality), 030 (communication error), and 033 (brake sensor error).
Step by step
Note the exact code. Write down the full three digit code. The first digit narrows it down: 02x is drive, 03x is communication, 04x is sensor.
Power cycle first. Many Bafang errors clear on a full power off and back on. Wait 30 seconds between.
Inspect the reported component. 021 means look at the controller and phase wires. 022 means check the throttle. 025 and 033 mean brake cutoff wiring.
Get a diagnostic if it persists. A Bafang programming cable and software reads live data and clears codes properly. Most mobile mechanics carry both.