Ellen Ripley is rescued after drifting through space in stasis for 57 years. She is debriefed by her employers at the Weyland-Yutani Corporation over the destruction of her ship, the USCSS Nostromo; they are skeptical of her claims that an Alien killed the ship's crew and forced her to destroy the ship.
The exomoon LV-426, where the Nostromo encountered the alien eggs, is now home to the terraforming colony Hadleys Hope. When contact is lost with Hadleys Hope, Weyland-Yutani representative Carter Burke and Colonial Marine Lieutenant Gorman ask Ripley to accompany Burke and a Colonial Marine unit to investigate the disturbance. Traumatized by her encounter with the Alien, Ripley initially refuses, but she relents after experiencing recurring nightmares about the creature; she makes Burke promise to destroy, and not capture, the Aliens. Aboard the spaceship USS Sulaco, she is introduced to the Colonial Marines, their commanding officer Lieutenant Gorman, and the android Bishop, toward whom Ripley is initially hostile following her experience with the traitorous android Ash aboard the Nostromo.
A dropship delivers the expedition to the surface of LV-426, where they find the colony deserted. Inside, they find makeshift barricades and signs of a struggle, but no bodies; two live facehuggers in containment tanks in the medical lab; and a survivor, a traumatized young girl nicknamed Newt who used the ventilation system to evade capture or death. The crew uses the colony's computer to locate the colonists grouped beneath the fusion powered atmosphere processing station. They head to the location, descending into corridors covered in Alien secretions.
At the center of the station, the marines find the colonists cocooned, serving as incubators for the Aliens' offspring. When the marines kill a newborn Alien, the Aliens are roused and ambush the marines, killing and capturing several. When the inexperienced Gorman panics, Ripley takes control of their vehicle and rams it through the nest to rescue marines Hicks, Hudson, and Vasquez. Hicks orders the dropship to recover the survivors, but a stowaway Alien kills the pilots, causing it to crash into the station. Ripley, Newt, Gorman, Burke and the remaining marines barricade themselves inside the colony command center.
Ripley discovers that Burke deliberately sent the colonists to investigate the derelict spaceship where the Nostromo crew first encountered the Alien eggs, believing he could become wealthy by recovering Alien specimens for use as biological weapons. She threatens to expose him, but Bishop informs the group of a greater danger: the power plant was damaged by the dropship crash, and will soon explode with the force of a 40-megaton thermonuclear weapon. He volunteers to crawl through several hundred meters of piping conduits to reach the colony's transmitter and remotely pilot the Sulaco's remaining dropship to the surface.
Ripley and Newt fall asleep in the medical laboratory, awakening to find themselves locked in the room with the two facehuggers, which have been released from their tanks. Ripley triggers a fire alarm to alert the marines, who rescue them and kill the creatures. Ripley accuses Burke of releasing the facehuggers so that they would impregnate her and Newt, allowing him to smuggle the Alien embryos past Earth's quarantine, and of planning to kill the rest of the marines in hypersleep during the return trip so that no one could contradict his version of events. Before the marines can kill Burke, the electricity is cut and Aliens assault through the ceiling. Hudson, Burke, Vasquez and Gorman are all killed and Newt is captured.
Ripley and an injured Hicks reach Bishop in the second dropship, but Ripley refuses to abandon Newt. The group arrives at the processing station, allowing a heavily armed Ripley to enter the hive and rescue Newt. As they escape, the two encounter the Alien queen in her egg chamber. Ripley destroys the eggs, enraging the queen, who tears free from her ovipositor. Pursued by the queen, Ripley and Newt rendezvous with Bishop and Hicks on the dropship. All four escape moments before the station explodes with the colony consumed by the nuclear blast.
On the Sulaco, Ripley and Bishop's relief at their escape is interrupted when the Alien queen, stowed away on the dropship's landing gear, emerges and tears Bishop in half. The queen advances on Newt, but Ripley clashes with her using an exosuit cargo-loader and expels it through an airlock into space. Ripley, Newt, Hicks and the badly damaged Bishop enter hypersleep for the return trip to Earth.

Question: How did Ripley ultimately defeat the alien queen?
Answer: She expelled it into space through a hatch in the ship