What is Beowulf's attitude toward his possible death?
When he faces the dragon as an old and wise king, Beowulf knows that his death is very likely imminent. Take, for instance, the following quote from Seamus Heaney's translation of the poem:
After many trials,
he was destined to face the end of his days,
in this mortal world, as was the dragon,
for all his long leasehold on the treasure.
Yet the prince of the rings was too proud
to line up with a large army
against the sky-plague. He had scant regard
for the dragon as a threat, no dread at all
of its courage or strength... (2341-49)
In this quote, we can see that Beowulf knows that he is very likely to meet his end in his fight with the dragon. That said, in proudly refusing to fear the dragon, Beowulf shows that he has retained his old battle courage even in old age. As such, he's seems grimly accepting of his fate and willing to head into battle one last time.
What's interesting about Beowulf's resigned attitude is what it says about the larger warrior culture in the poem. The world of Beowulf is a violent one, and even the most prosperous settlements (such as Heorot) are on the brink of chaos. As such, the characters in this world, especially the warriors, live with the knowledge that death in battle is very likely. In that case, Beowulf's attitude is an example of this particular world's warrior code: since life is precarious and death in battle is a likely end, the best thing to do is to meet such an end with dignity and courage. All in all, Beowulf's final resignation is exemplary of not only his own courage, but also the violent, dangerous nature of his own society.
You don't indicate which part of Beowulf you are looking at.
Beowulf believes he will be successful against Grendel because the omen for his success have been good. Nevertheless, Beowulf believes in Wyrd - Fate - that will have decided the outcome of his battle before he even fights. In the Burton Raffel translation, Beowulf says, "Fate will unwind as it must." He also recognizes going against Grendel that there may not even be enough of him to bury (or burn).
Going against the dragon in the third section he is less optimistic. He recognizes that he is not as young or strong as he once was. Even so, he is the good leader to the end and will fight the dragon.
Beowulf knows his time has come. He is physically older, and not mentally as sharp has he had been in his heyday. He accepts his imminent death but has some natural human reluctance to leave life. He is very saddened that all those who should have been loyal to him have deserted him, save young Wiglaf. Wiglaf, at least, has demonstrated qualities of heroism and is to him that Beowulf will bequeath his title (he has no other heirs).
Beowulf does believe in fate, and his premonition leads him to believe his time has come. Yet, he also wants to reflect on his life , to relive his "glory days" before his last battle.