Ans: you need a gear puller.
Do not try to pull the gear out without the special puller, or you may need to buy a new motor from Lightobject :)
Pay attention to the gear whether a locking screw is used. If so, you need to lose it first before trying to pull the gear out. The puller's pivot may be too big to get into the gear; then, you need help from a longer screw or use any solid spacer.
If you want to reuse the pulley gear, it is ok if it comes with a locking screw. Otherwise, you need to apply glue to the motor shaft. If not, then the gear may skip and it is extremely difficult to do troubleshooting when an issue arose.
Reminder: To install the gear back to the motor, make sure you put a support stud beneath the shaft, or you will damage the motor for sure!