Is my Relay is connection is wrong?

hi guys i'm new to arduino projects i have an relay to make my solenoid valve on and off with a given period of time but every time i connect it to my solenoid valve to my relay it automatically opens it's just like it's bypassing the relay, the relay works fine in with the set time but i didnt turn on or off my solenoid valve any help is much appricated i'm using arduino mega 2560 and this is my code

thesisbackup.ino (9.32 KB)

When asking hardware questions it is most helpful if you include a schematic of the circuit. A relay most likely cannot be driven directly with an Arduino output. What is driving the relay? Making it necessary to download your code limits the number of people who can or will help you. Read the "how to use the forum' stickies to see how to format and post code.

A schematic can be hand drawn and a photo posted.