Insomnia seriously affects normal work and life. There are many causes of insomnia, and psychological factors are a very important cause of insomnia, so attention should also be paid to adjusting the psychological state while carrying out treatment. Long-term insomnia can cause changes in mood, depending not only on the length and severity of insomnia, but also to a considerable extent on the patient’s psychological state towards insomnia and attitude towards the use of sleeping pills. Some people suffer from severe insomnia but have a good attitude towards it, while others are so emotionally affected by insomnia that a single bout of insomnia can produce very strong disturbances. Some patients will have obvious anxiety before going to bed, worrying whether they can fall asleep or not, and have ambivalence about taking sleeping pills, always hesitating over whether to take pills, wanting to control as much as possible without taking pills, and once they cannot fall asleep and have strong anxiety and double the sleeping pills, making the use of sleeping pills out of control. Among the many causes of insomnia, psychological factors account for a large proportion, such as mental tension, depression, anger and anger can cause insomnia, and in turn insomnia will affect people’s psychology. Insomnia can cause lack of energy, depression, lack of concentration, low mood, impatience, nervousness and temper, long-term chronic insomnia can cause a certain degree of “negative state of mind”, that is, depression. Depression is accompanied by insomnia in 90% of patients, and insomnia in depression does not necessarily mean that the patient cannot sleep, but more often means waking up early and having difficulty falling back to sleep after waking up. When depression is cured, the symptoms of insomnia also improve. Therefore, insomnia and depression are causally related to each other, so the diagnosis and treatment process of insomnia patients should pay attention to the patient’s emotional state.