"Defeat Miraak" is an objective in the main quest "At the Summit of Apocrypha" in Elder Scrolls V: Skyrim - Dragonborn.
Walkthrough
Sahrotaar will land in front of you. They will congratulate you the Dragonborn on their mastery of the Thu'um. It will offer you a ride to where you can then confront Miraak.
You get to ride and control the dragon for now. Be wary of the various enemies that can attack you. Make your way to the marked location, the highest tower.
Land on the tower and dismount from your Dragon. Approach and talk with Miraak.
The next part is up to your preference. You can either engage Miraak directly or return to your dragon and fight from the air. He will be aided by 2 dragons: Kruziikrel and Relonikiv. This is not a hard fight, but it is long. You will need to kill Miraak 3 times for it to take. The first two, when he is weakened, Miraak will kill the dragons and use them to regenerate his health.
Defeating Miraak will award you with 6 Dragon Souls in addition to however many Dragon Souls Miraak stole from you. Hermaeus Mora will appear and skewer Miraak on one of its tentacles. It will then allow the souls to transfer to you.
Approach Miraaks's corpse and loot it. You can get all his gear. After that, interact with the Book that has risen from the middle to be taken back to the Skaal Village or wherever you read the Black Book. Doing this will give you a chance, for one Dragon Soul, to respec any Skill Tree that have you. You can always re-read this Black Book to do this. Read the book agian to be brought back to Mundus.