Do you have a multimeter? First, find two pins with 3.3V and one with 0V. Connect the black cable to 0V and the red to 3.3V. You should hear silence. Now connect the yellow to 3.3 as well, and you should hear a buzz.
No? Ok, some more explanation.
You want to power something. That requires that those pins can deliver that power. Power supply pins can do that, processor pins cannot. So, you want the red cable connected to a power supply pin.
The easy way to test this, is that the power on the red and yellow pins has to stay above 3.3V when connected. If it drops, it was a processor pin and not a power supply pin.
When you found the right pins and the buzzer makes noise, it is time to program a pin. Write and execute your program and measure if the voltage on the pin switches between 0 and 3.3V. If it did, use that for the yellow cable.
If it still doesn't work, you need a pull-up resistor, like Thaddy posted. Start with 10k, if that doesn't work, try 4.7k.
If it still doesn't work, post specs.