The final scene of the play, Act V scene 9, is the scene you want to focus on. Notice that Macbeth meets his end at the hands of Macduff at the end of Act V scene 8, when we are told that these two characters exit the stage and then re-enter fighting, and then "Macbeth slain." In Act V scene 9, Malcolm and Siward walk together around Macbeth's castle, which they have now conquered. Ross tells Siward the news that his son has been killed. Macduff then emerges with Macbeth's head, and proclaims Malcolm King of Sotland. Malcolm's first act as King is to declare that all of his thanes will be made earls, following the English custom of peerage. This will be a break from Scottish tradition, and they will be the first lords in Scottish history. As Malcolm calls his fellow soldiers his friends, inviting exiles from Macbeth's rule back to Scotland, and invites them to his crowning, he curses Macbeth and his wife:
...Of this dead butcher, and his fiend-like Queen,
Who as 'tis thought, by self and violent hands
Took off her life...
The play thus ends after Macbeth's death with the restoration of stability and the crown passing to Duncan's son, who should have had it in the first place. We expect more peaceful times for Scotland.
After Macduff kills Macbeth and carries his severed head onto the stage, Malcolm is officially restored as the King of Scotland in Act Five, Scene 8. All of the thanes then praise and accept Malcolm as their new king. Malcolm then proceeds to name all his thanes and kinsmen to be the first earls of Scotland. He then says that they must call home all of the exiles that left Scotland during Macbeth's reign, as well as punish those ministers who served under Macbeth. Malcolm ends his speech by inviting everyone to witness him receive the crown at Scone as the play ends. Essentially, peace is finally restored to Scotland as Malcolm becomes king. His thanes and kinsmen receive promotions and those that fled Scotland during Macbeth's reign are invited to come home.