anyone can teach me how to write a source code for my project?

my project is to control a light using arduino mega 2560+RTC DS1302...the light will be turn ON and OFF at the specific time....right now im having trouble figuring out how to write the source code for this project..is there anyone can help me or guide me so i can finish this project??

Have you worked through any of the examples in the IDE?
What difficulties did you have?

How far have you got so far - or in other words, which part are you stuck at?

Do you have any code you've worked on that you can show us?