The end of a spaceflight is the time when the astronauts aboard are in the most danger. Just before landing, the spacecraft has to re-enter the Earth’s atmosphere from space. At this point, the spacecraft is traveling very fast. As it rushes into the upper atmosphere, friction with the air heats the outside of the spacecraft so much that it glows red-hot.
The base of the spacecraft has a heat-resistant shield that enables it to withstand this intense heat. Of course, the spacecraft must be in the right position so that the heat shield strikes the air. If not, the whole spacecraft could burn up.