Short 2 wires when a third is powered
If there should be no electrical connection between the Arduino and the wires you want to connect, the best device is likely to be a relay. You can get electronic circuits using optocouplers instead of mechanics for isolation that simulate a relay called "solid state relay". In certain circumstances, a single optocoupler (with a series resistor on the LED side) might alread do the job you need.