Want to turn on a relay by connecting 2 wires

Maybe you can show your code and explain exactly what you mean by "code is not working."

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/681310