"To Build a Fire" ends on an ironic note, with the dying man vividly imagining various scenes:
He pictured the boys finding his body next day. Suddenly he found himself with them, coming along the trail and looking for himself. And, still with them, he came around a turn in the trail and found himself lying in the snow. He did not belong with himself any more, for even then he was out of himself, standing with the boys and looking at himself in the snow... He drifted on from this to a vision of the old-timer on Sulphur Creek. He could see him quite clearly, warm and comfortable, and smoking a pipe.
This passage is ironic because, as the narrator stated at the beginning of the story, the man's fatal flaw is his lack of imagination and his inability to understand the significance of things. And yet, now that he's lying in the snow and is on the verge of death, he finds himself capable of very vividly envisioning a made-up scenario. It's ironic, then, that his original lack of imagination is what leads to his death—and even more ironic, of course, that as he is dying, the man finally seems to develop an imagination. Only in death does he access an ability that, if used earlier, would have kept him alive.
One of the tactics London uses in "To Build a Fire" is dramatic irony. At the beginning of the story, he states that while the man believes the temperature to be about 50 degrees below zero, the dog better understands just how cold it is.
The animal was depressed by the tremendous cold. It knew that it was no time for travelling. Its instinct told it a truer tale than was told to the man by the man’s judgment. In reality, it was not merely colder than fifty below zero; it was colder than sixty below, than seventy below. It was seventy-five below zero.
At this point, the reader possesses knowledge that the man does not and better understands the danger of traveling in such weather. There's an acute sense of danger and impending doom, but the man doesn't seem all that aware of the trouble he's in. Readers therefore end up feeling somewhat aligned with the man's dog, since the dog instinctually understands the gravity of the situation. This use of dramatic irony highlights the man's lack of experience when it comes to traveling in the Yukon, and it also underscores the unreliability of his judgement, which is in direct contrast to the accuracy of the dog's instinct.
The moment when a pile of snow falls and blots out the man's fire is the most dramatic and climactic moment of the story. It is also an example of situational irony—at the exact moment the man believes himself to be safe and begins to relax, disaster strikes.
He should not have built the fire under the spruce tree. He should have built it in the open. But it had been easier to pull the twigs from the brush and drop them directly on the fire. Now the tree under which he had done this carried a weight of snow on its boughs. No wind had blown for weeks, and each bough was fully freighted. Each time he had pulled a twig he had communicated a slight agitation to the tree—an imperceptible agitation, so far as he was concerned, but an agitation sufficient to bring about the disaster.
This moment is especially ironic because the actions the man takes to build the fire (gathering twigs) and the heat of the fire itself, which should be a source of life, ultimately cause his death. He thought that building the fire beneath the spruce tree would make his life "easier," but taking this shortcut actually ends up making it all but impossible for him to survive.
Things begin to go downhill for the man the moment he falls into a hidden pool of water, and this moment is an excellent example of situational irony.
And then it happened. At a place where there were no signs, where the soft, unbroken snow seemed to advertise solidity beneath, the man broke through.
Irony is broadly defined as a literary device or event in which there is a difference between how things appear and how they actually are in reality. This moment in "To Build a Fire" fits this description quite literally—the ground appears solid, but it is not.
This event is also ironic because, knowing how dangerous the pools of water can be, the man has been very careful to avoid them. Throughout the story, he has closely observed his surroundings, and though he has been careless in other ways, the one thing he has remained vigilant about is making sure he doesn't step anywhere that might cause him to fall into the frigid water. The reader might expect that any accident that befalls the man will happen as a result of him becoming careless or failing to pay attention, but it actually occurs due to random chance. The irony of this moment reinforces the Naturalist belief that human lives are ultimately shaped by forces outside their control.