Relay not working with Particle photon

I did the change you said and connected to D^ relay worked fine but when i connected it to the main electricty the relay stops working the Relay red light works well but the sound of the click inside doesnt work and the switch doesnt work.I dont understand,The photn becomes very hot as well

Cannot understand your run-on sentence. did you say something worked?

edit: you may want to try transistor switching to step up the 3.3V signal from the output pin on Particle to the input pin on the relay

do you have transistors?

@nilesh please be very careful if you are a beginner working with AC or mains electricity. As @BulldogLowell mentioned, if you have a transistor you can use a digital pin like D6 or D7 to activate it and pass a 5V signal from V_USB to the relay.

Another relevant thread for you: