Macbeth is killed by Macduff in a battle in the last scene of the last act. Macduff beheads him.
Macbeth kills Macduff’s entire family, so during the battle Macduff has vowed to personally avenge their deaths by killing Macbeth. The witches have warned Macbeth that he cannot be killed by just anyone. He assumes this means he cannot be killed.
Thou wast born of woman.(15)
But swords I smile at, weapons laugh to scorn,
Brandish'd by man that's of a woman born. (Act 5, Scene 6, p. 86)
In the end, it turns out that Macduff has not been born of woman because he was born by C-section. He not only can kill Macbeth, he does.
Hail, King! for so thou art. Behold where stands
The usurper's cursed head. (Act 5, Scene 7, p. 89)
So in the end Macbeth is killed by Macduff, who ends his tyranny and returns the kingdom to Malcolm. Macbeth is prepared to die once he realizes that Macduff was not of woman born, and he essentially gives up.