I think that a good example of dramatic irony in Macbeth is when King Duncan comes to the castle of the Macbeths for a visit to celebrate Macbeth's elevation to Thane of Cawdor and the audience knows that the king is going to be murdered, but the king has no idea.
The king does not know that he has walked into a trap. The Macbeths have a lovely party, Lady Macbeth especially, pays respect to the king, honors the king and celebrates with him. She tells her husband that they must not reveal from their facial expressions or their demeanor any of their plans for later that night. She tells him:
Lady Macbeth: Your face, my thane, is as a book where men
May read strange matters. To beguile the time,
...look like the innocent flower,
But be the serpent under't. (Act I Scene V)
Macbeth is a villain in my view, he grabs the opportunity to be king with both hands. He kills the king, even though he is having second thoughts. His failure to resist temptation, as illustrated by the witches prophecy, result in the total corruption of Macbeth's personality, the forfeiture of his soul and his total destruction.
Dramatic Irony is when the reader/audience knows more than one or more characters on stage. Sometimes one or more characters also share the same information the audience has (e.g., in Romeo and Juliet Romeo knows he's listening to Juliet's declaration of love for him, and we know he's in the bushes under her balcony, but she does not have this knowledge).
In Macbeth, the most memorable example of dramatic irony is that the witches and Hecate are going to use the apparitions to mislead Macbeth and cause his downfall: we know about it but he doesn't
We also know that Macbeth is feeling guilty and remorseful because of Banquo as well as Duncan. Lady Macbeth only knows about Duncan in Act III, scene ii.
Lady Macbeth: What's to be done?
Macbeth: Be innocent of the knowledge, dearest chuck,
Till thou applaud the deed. Come, seeling night,
Scarf up the tender eye of pitiful day;... (III.ii)
Dramatic irony is when the reader knows something but the audience doesn't. A main example of dramatic irony shown in Macbeth is when Duncan comes to visit Macbeth at his castle but doesn't see his death coming to him. Duncan says "this castle hath a pleasant seat" (1.7) Shakespeare uses dramatic irony because Duncan is describing Macbeth's castle as comfortable and as a welcoming atmosphere, but the audience knows that Macbeth has decided to kill him, so therefore it would not be a "pleasant" place to stay at all. The suspense is definitely building up and the audience/reader gains a feeling of excitement and tension.
At the beginning of the play Macbeth, the three witches, who tell Macbeth of what is to come, recite the words, “Fair is foul, and foul is fair” (I.i). This is an example of irony as the witches mean to mislead Macbeth, through all of the prophecies they tell him. We know that this is going to happen, but Macbeth only realizes their evil means at the very end of the play.
At the beginning of Act II, Banquo and his son are greeted by Macbeth, who calls himself a "friend" (II.i). Macbeth is nothing like a friend. This becomes dramatic irony, as we know that Macbeth will need to kill Banquo, because he knows too much and might become suspicious, but Macbeth does not consider this yet.
Banquo: Give me my sword.
Macbeth: A friend.
Banquo: What, sir, not yet at rest? The king's a-bed:
He hath been in unusual pleasure,... (II.i)
Macbeth and Lady Macbeth plot to kill King Duncan, as the witches foretold that Macbeth would be the king of Scotland. When King Duncan is arriving at Macbeth’s castle, it is a sunny and bright day. He says to himself, “This castle hath a pleasant seat; the air nimbly and sweetly recommends itself unto our gentle senses” (I.vii). Duncan then takes Lady Macbeth’s hand, who leads him into the castle. This scene is extremely ironic, because we would think (if walking into the scene right now) that Macbeth and King Duncan are just good friends, having a visit. In reality, Macbeth is getting ready to kill the man who is before him, and so the sweet air and the beautiful sunlight makes the scene even more ironic.
I think that Shakespeare has used the technique of dramatic irony well, as the audience (when watching the play) wait, as the suspense builds up, and as tensions tighten, giving a real sense of Shakespeare as a master playwright. The audience are on the edge of their seats, anticipating what will happen next, only to find that they have to wait a bit more each time, until there is a massive climax.