As per my knowledge, this motor contains a two channel quadrature encoder which has four connectors and the remaining two connectors are for the motor supply. In the following image, pins Motor+ and Motor- are for connecting motor supply voltage source while Sensor Voltage + and Ground is for connecting sensor input voltage. However, please note that the Motor- and Ground should not be connected together. The output can be sensed from pins Channel A and Channel B. This output will be in form of pulses.
In your Arduino program, you must maintain a counter variable because such incremental encoders don't provide an absolute value of angle or speed. You will need to poll these two channels and decide wether to increment or decrement the count. The calibration of this count would depend on the specifications of the encoder. Please read the following pages for more information on operation of encoders:
You can use a HCTL 2022 decoder IC to avoid this procedure and directly read the angle values. This will save you computational overhead but make the circuit more involved. Please refer the image attached to this post for circuit diagram from one of my projects.
Regarding the hardware requirements, you will need L298N to drive the motor and an Arduino Mega to implement a PID controller. Optionally, you may want to use an appropriate decoder IC.