The moral of the story is that you should not count your chickens before they hatch, meaning depend on things you don’t yet have. Also, that you should beware prophesies because they can be misleading, and you can make them happen by acting to prevent them.
We first meet Macduff when he has his bizarre conversation with the porter right before Duncan’s body is discovered. At that time, we know little about him. He seems to be a loyal subject of Duncan, and he is definitely dramatic. In Act II, Scene 3, he reacts to Duncan’s death this way:
Approach the chamber, and destroy your sight
With a new Gorgon. Do not bid me speak;
See, and then speak yourselves. (Awake, awake!) (enotes etext pdf. pg. 31)
Notice that Macduff does not go to see Macbeth crowned. He goes home.
Well, may you see things well done there, Adieu,
Lest our old robes sit easier than our new!(50) (p. 39)
Macbeth begins to worry about him when he does not come to the banquet the night Banquo is killed. In Act 3, Scene 4, Macbeth notes that he is not there, and then suggests that he has spies in all of his nobles’ castles.
How say'st thou, that Macduff denies his person
At our great bidding? (p. 48)
The witches’ apparitions confuse Macbeth by telling him to beware Macduff, but also telling him he cannot be killed by a man born of a woman.
Then live, Macduff. What need I fear of thee?
But yet I'll make assurance double sure,
And take a bond of fate: thou shalt not live,
That I may tell pale-hearted fear it lies,
And sleep in spite of thunder. (Act 4, Scene 1, p. 60)
When they do finally meet, Macbeth learns that Macduff was born by C-section. Macduff was actively seeking Macbeth during the battle for revenge, since Macbeth had his entire family killed. Thus, Macbeth counted his chickens before they hatched—and didn’t have them long. By killing Macduff’s family, he caused the prophecies to come true. Birnam wood came to Dunsinane, and he was killed by Macduff, a man not born of a woman (strictly speaking).