Motors through digital

I'm trying to make a small project that utilizes small DC motors that run on 3 to 7 volts. I tested the circuit and program with led's in place of the motors and it works, but when substituted with the motors, they don't work. I tested the motors through the 3.3 and 5 volt pin and they work. The problem is that the motors won't run when using digital pins. Any ideas? Suggestions? There are four motors involved.

Power the motors from a 5V supply, with arduino pin controlling a transistor to turn the motors on & off. IO pins are only good for 20-30mA, not enough to drive a motor.

The motors are supposed to be turned on in certain conditions. I am pretty new at this. Can a transistor work with that sort of program?