Unplug the power cable running from the garage door motor to the power source.
Remove the screws holding the motor housing in place and remove the motor housing. You now have access to the internal components, including the gear and sprocket.
Remove the pin from the end of the gear to free the gear.
Slide the gear off its rod to remove it.
Remove the nut on the chain over the sprocket. Slide the chain off of the sprocket.
Remove the screws holding the sprocket in place and remove the sprocket.