At the end of act II, scene II, Macbeth converses with his wife after he returns from Duncan’s room, where he just killed the king. After they talk about the bloody knives, they hear someone knocking at the door. Macbeth is finding out that his emotional reaction to committing murder is much more severe than either he or Lady Macbeth had anticipated. Macbeth is beginning to experience the guilt and remorse that will plague him through the rest of the play.
When Lady Macbeth leaves to replace the knives, Macbeth is left alone. He is alarmed to hear more knocking:
Whence is that knocking?
How is't with me, when every noise appalls me?
It surprises him that he is so nervous that every sound is alarming.
After his wife returns, they hear more knocking. She suggests they put on their night clothes so anyone who meets them will assume they were asleep. She also chastises him for being so lost in his thoughts. Macbeth says,
To know my deed, ’twere best not know myself. Knock
Wake Duncan with thy knocking! I would thou couldst!
Macbeth wishes that he did not know about the things that bother him, both what he did—that is, kill the king—and who he is—a murderer. In pretending to address the unknown person who is knocking, telling them to wake Duncan, Macbeth is wishing that Duncan was just asleep, not dead.