using arduino to open and close a circuit

Try some of the examples in the Learning section.
Reading an input, writing an output are very basic functions.