Aurdino uno r3 to 5v relay

It all begins with digitalRead, followed closely by digitalWrite.