Where did you buy the pinion from? If you ordered online, the place you ordered it from "should" have the bore sizes in the specs. The same for the motor, you should be able to look online for the specs of the motor which will include bore size.
For example:
https://www.amainhobbies.com/robinso...rrp0160/p49534
You see the bore size. And then like this combo:
https://hobbyking.com/en_us/tracksta...em-4300kv.html
There is a shaft size. If you were to convert that pinion bore to mm, you would be about 3.1 mm. That's probably not going to work. The motor is listed as 2mm so I would search for a pinion with a 2mm bore like this: