if Thor is even capable of dying before Ragnarök occurs.
The most prominent time Thor has faced death comes in the Climax of Walt Simonson's run, which takes place from Thor # 380-382, wherein the Prince of Asgard does battle with the serpent Jormungand, who is fated to kill Thor during Ragnarök. Thor manages to defeat the serpent, but he is able to avoid death due to previously being cursed by the goddess of death Hela. Simonson's Thor is considered to be the gold standard run for the character, and no writer since has merged the myths and the Comic version together quite like Simonson. But despite constantly referencing Ragnarök, Thor technically doesn't die and Asgard remains safe at the end of Simonson's run.
Years later, Thor would face death once again in Thor Vol. 2 #85, where the God of Thunder would put a stop to Ragnarok, prematurely. In this run, it is revealed that the people of Asgard have already died and been reborn multiple times in Ragnarok, which was caused by a mysterious group of gods called "Those Who Sit Above in Shadow" who feed off the cycle of destruction and rebirth to empower themselves. The people of Asgard all seemingly die here in what is described as the "final Ragnarök." While Thor destroys the world tree connecting the Nine realms together, it is subsequently revealed in Thor Vol. 3 that Thor was able to restore the Asgardians and break his people from the cycle of Ragnarök by relocating Asgard to the town of Brixton, Oklahoma. Points for creativity on Thor's part.
The final, canon fate of the God of Thunder would only be revealed very recently in Jason Aaron's run on Thor. According to Aaron, Thor is destined to finally die only after he succeeds his father Odin and becomes All-Father of Asgard. In this future timeline Thor has ruled the Nine Realms for countless centuries until the literal end of time, where there is no life left in the universe except for himself and Wolverine. This Thor, dubbed "King Thor" is considered to be the "official" future of Thor now until another writer chooses to retcon it.
King Thor's last days alive are depicted in full in 2019's 4-issue miniseries King Thor. According to King Thor #4, the King of Asgard is fated to rule the Nine Realms as All-Father until it is finally time for entropy to take the universe, at which point he will give his hammer Mjolnir to his descendants and sacrifice himself to restore life to the universe. It's a somber, heroic death, and it's also the perfect ending for a hero as legendary as Thor.