The book The Time Machine is, for the most part, a frame-story: that is, a story-within-a-story. The original narrator tells that he has met a man, known to readers simply as "the Time Traveller," who claims to have built a machine that can carry him forward and backward through the fourth dimension (time), just as other machines are able to carry objects forward and backward through the first three dimensions (space). The basic scientific principle at work is that the fourth dimension is no different from the first three.
At a dinner party, the Time Traveller recounts how he has been able to use the machine to reach the distant future. First, he travelled to a time several hundred thousand years in the future, when human beings have degenerated into a small, child-like civilization of humans called the "Eloi" that feeds largely on fruits and vegetables and are hunted and killed for food by the so-called "Morlocks." Then, after recovering his machine from the Morlocks, who have been using it as bait to try to capture him, the Time Traveller went to a period tens of billions of years in the future, where he witnessed the death of the sun and the end of all life on earth. The Time Traveller returns from this later period to his own time using his own machine.