holmes4:
Read the reference section!.
Specifically look at the digitalRead() and digitalWrite() functions. If you're familiar with other microcontrollers this should get you on the way. As Mark mentioned above delay() might not be ideal for your project as it is a blocking function - your code will mostly not respond to external inputs while it is running. I wouldn't go so far as to say never use it, but it's rare that it's the best choice for anything more than the most simple cases.
If you are completely unfamiliar with Arduino there are some excellent tutorials available not just here, but also on youtube. This series by Jeremy Blum is a good place to start imo.
All the best,
Geoff