The textbook way is to use a gear puller.



The hobby ones for that size pinion generally suck but do work if you are careful. They are available at many R/C stores and Hobbyking. The one from HK looks better than most.