The pins have to be set as output and low. This way you can sink up to 20mA of current on each pin.
If you are trying to read a sensor, you need to disable the internal pull up resistors and add an external 10k resistor between the pin and GND. The sensor will be connected to the pin and the pin will read low if no signal is received and high if the sensor is triggered.