Beowulf went to go fight the dragon to have his tresure. This is the battle that eneded Beowulf's life. Beowulf was close to death but then Wiglaf came and stood by Beowulfs side and helped him defeat the dragon while his other men ran for their lives. Wiglaf fought with Bewoulf and helped him defeat the dragon. Wiglaf stabbed the dragon and then Beowulf took his chance and used his dagger to cut the beast in half, slit it apart.

A quote from the book: " Ignoring 
The dragon's head, he helped his lord
By striking lower down. The sword
Sank in; his hand was burned, but the shinning
Blade had done its work, the dragon's
Belching flames began to flicker
And die away.'