When an astronaut leaves a spaceship that is moving through free space, the spaceship does not move off and leave the astronaut behind.
This is because when the astronaut is inside the spaceship, which is moving in free space, the astronaut also has the same velocity as the spaceship. Hence, when he leaves the spaceship, there is no relative velocity between the spaceship and the astronaut. This is the reason why the spaceship will not move off and leave the astronaut behind.
A spaceship or a spacecraft is an especially designed vehicle that is used to travel to outer space. It can be used for space exploration, transportation of humans and cargo, and meteorological purposes.
An astronaut is a person who has undergone specific training to travel to space. The duties of an astronaut aboard a spaceship can vary. Usually, a pilot and a commander work together to lead the mission. Other positions could be science pilot, mission expert, payload commander, and flight engineer.