The motif of sleeplessness first occurs in Act 2, scene 2. After Macbeth kills Duncan and returns to his chamber, we can see that he is already in the grip of guilt and severe anxiety. He tells his wife, "There's one did laugh in's sleep, and one cried, “Murder!" (30). He tells her that the servants were crying out in their sleep with "God bless us" and "Amen", as if they had seen him murder the king. Yet when Macbeth tries to pray he could not, a fact that distresses him greatly.
When Lady Macbeth urges him not to dwell on the matter ("consider it not so deeply"), he seems unable to hear her. He continues to recount his experience: "Methought I heard a voice cry “Sleep no more! Macbeth doth Murder sleep--” (35-36) and “Glamis hath murdered sleep, and therefore Cawdor Shall sleep no more. Macbeth shall sleep no more" (43).
Macbeth next mentions sleeplessness in Act 3 scene 2, just after her orders the murder of Banquo and his son Fleance. Although he has no idea that the plan will go awry, he tells Lady Macbeth it is better to be dead, like the King, than to lie in bed tortured by doubts and fears--a suggestion that he has been suffering in this way himself. Coincidentally, his statement mirrors one that Lady Macbeth makes while alone on the stage (see Act 3 scene 3 ll 6-9). Later in the act, after Macbeth has made a spectacle of himself reacting to Banquo's "ghost", Lady Macbeth tells him that he lacks sleep, "the season of all natures" (170).
Ironically, it is next Lady Macbeth who next has trouble with sleeping--or at least with sleeping while not walking and talking at the same time. In Act 5, scene 1, the Doctor and Gentlewoman are bewildered to witness her episodes of sleepwalking, which are accompanied by such morbid ramblings about blood, guilt, and murder that the Doctor claims that her ailment can only be cured by God: "More needs she the divine than the physician" (68).