if the piezo speaker uses less than 30 mA (almost all do unless it's extremely large) then you can attach the red wire to a arduino pin and the black to ground. to code it you would make the pin a output as usual. to play noise through it you would put this for example.
tone(piezoPin,2000,500);
this would play a 2000 hertz square wave on the piezo pin for 500 milliseconds