how to use switch as sensor and send interrupt signal to send sms using gsm when the signal is sent

This question has nothing to do with sensors. Using a switch as a sensor is trivial. But the rest of the question is anything but.

send interrupt signal

Why an interrupt you don't need to use interrupts.

to send sms using gsm

So what equipment are you using? Just modify the example sketches that come with the equipment.