the motor you show has a stall current pf 3.2A. - voltage not shown, but 5v should get it spinning
I guess it will take a good proportion of this when driving a reasonable load.
An arduino output pin will only supply 0.04A . The arduino on board regulator will only supply about 0.05A.
The 2N2222 is a small tansistor - will handle only about 0.1A.
So : get a suitable big power supply. Get logic level power MOSFET to control the power
Until your hardware has a chance of working, fiddling with code will get you nowhere.
regards
Allan.