While Star Wind's answer is best as far as addressing what was not asked, but was probably the intent of the question, for educational purposes:
To control the printer you need an microcontroller (most popular are Arduino) which will interface with the motor drivers. Microcontrollers cannot output the current needed to control the motors, so motor drivers (such as this https://www.pololu.com/product/1182 ) are easy ways to control a stepper motor with higher current (and usually voltage). You can build your own if you are particularlly adventurous, they are essentially two H-bridge circuits.
The Arduino programming environment has a library for controlling stepper motors through a driver built in, you just tell it which pin to send the pulses to, and how fast, and a separate pin tells it to spin clockwise or counterclockwise.
For a 3D printer you need at least four motors working in unison, one for the X, Y, Z axis, and one for the extruder (E axis).
The existing programs that 3D printers use (Marlin, Sprinter, Teacup, etc) are all doing these simple steps at their core, but have implemented libraries of G-code that the printer uses to make control the stepper motors in unison to make the correct shape. Slicing programs such as Cura or Slic3r take in the 3D model and output the Gcode that the microcontroller is programmed to understand.