hi swetha.
I've read some things about it.
I think (but I'm not sure) that hypnosis works because it brings the patient into a state of altered consciousness in which she/he is neither asleep nor awaken, it's an intermediate level, I believe it is the subconscient (the unconscient is the last one)
in that level the hypnotherapist can "enter" into the patients mind (better say the patient himself enters his own mind) and reprograms his mind, his thoughs, his beliefs,his feelings, so that when the patient "awakes", his subconscient remembers what has been done and "commands" the conscious to behave the way that is expected.
hope I could help you.

***