Secondly, the combination of anxiety, stress, and self-efficacy of medical staff act on their sleep quality. Anxiety affects sleep quality because anxious people often find it difficult to fall asleep and may wake up frequently during sleep [27]. Also, the combination of anxiety with sleep disorders may make it difficult to fall asleep [28]. The fact that stress is closely related to sleep quality has been confirmed by a previous study [29]. Increased stress can increase the levels of vigilance regarding the environment, which will reduce sleep quality [30]. However, self-efficacy is a positive mental state that may enhance sleep quality [31]. People with high self-efficacy can maintain relatively stable emotions even under pressure, and they may experience fewer episodes of night waking, sleep anxiety, and sleep onset delay [32]. Self-efficacy also increases concentration and self-control [33]. Even though all medical staff experience pressure at work, people who have high self-efficacy are able to control their emotions and try to sleep regularly after work. Therefore, with high self-efficacy, medical staff may have good sleep quality. Anxiety has been shown to increase sensitivity to work pressure and the working environment and has a negative effect on self-efficacy because it reduces positive behaviors and initiative [34,35].