The first of Marvel Comics' "Infinity" crossover events was Infinity Gauntlet in 1991. Written by Thanos creator Jim Starlin (a godfather of the Marvel Cosmic Universe), the six-issue miniseries detailed the apocalyptic peril of Thanos acquiring and wielding the Gauntlet, as a means of impressing the living incarnation of Death by killing half the universe.
On Earth, as the world begins to tear apart, The Avengers and other heroes combine forces with mystic characters like Doctor Strange and cosmic characters like Adam Warlock (a major Marvel character who was already teased in Guardians of the Galaxy) to hatch a desperate plan to stop Thanos by storming his cosmic stronghold. In his arrogance, Thanos allows the heroes a slight chance at victory, but after near defeat, he triumphs and slaughters them all.
After battling forces of the universe itself (Galactus, Order & Chaos, Eternity), Thanos ultimately has the glove snatched by his daughter/puppet, Nebula (also introduced in Guardians of the Galaxy) - who in turn has it snatched by Adam Warlock.
As a more benevolent master for the Gauntlet, Adam Warlock is left to act as God of the repaired Marvel Universe, while Thanos is exiled to a humble life as a farmer.
In the sequel to Infinity Gauntlet, Adam Warlock takes possession of the Infinity Gauntlet and expels all good and evil from himself to become a purely rational and objective deity. Unbeknownst to Warlock, those good and evil sides take on lives of their own, with goals that threaten the entire universe.
Meanwhile, fearing Warlock and his Infinity Gauntlet, the entities of the cosmos decree that the six Infinity Gems can never again be used in unison, forcing Warlock to give up the Gauntlet and distribute the gems amongst himself and five other guardians of his choosing (including Gamora and Drax). Soon after that, the cosmos are threatened by the Magus, who is actually the evil version of Warlock.
When the Magus obtains multiple Cosmic Cubes, he uses their reality-altering power to imprison the personification of Eternity and create a dimension of dark dopplegängers to replace Earth's superheroes. While the heroes fight their evil twins, The Magus hatches a plan to eliminate them and capture Adam Warlock and the Infinity Gauntlet.
In the final showdown, Thanos allies with Adam Warlock to battle the Magus and his doppleganger army. Meanwhile, in a state of duress, the forces of the cosmos decree the Infinity Gauntlet to once again be usable - bad timing, since the decision gives the Gauntlet-weilding Magus the power of godhood. Manipulating his connection to the Gauntlet, Warlock draws out some cosmic forces to help defeat the villain, revealing that he had hidden one of the Infinity Gems with Thanos, meaning the Magus never achieved true omnipotence.
In the aftermath of battle Warlock is left comatose, the Magus imprisoned in the Soul Gem, and Thanos left to once again roam the universe...
In the third and final chapter, we learn that Warlock's good side (a female warrior called The Goddess) stole the Cosmic Cubes from The Magus during Infinity War in order to add them to her own massive collection. With enough cubes in her posssession, The Goddess creates a Cosmic Egg capable of altering reality (if fueled by enough willpower), and she brainwashes devout or "death-touched" heroes to be her army and fuel supply of willpower, establishing her own utopia on Paradise Omega, a planet she wills into being.
Thanos and an awoken Adam Warlock (along with various Earth heroes) once again ban together to defeat the threat, devising a strategy based off intel supplied by the devil, Mephisto. Warlock's army storms Paradise Omega to do battle with their brainwashed comrades, forcing The Goddess to enact her true plan: universal peace by annihilation of sentient life.
Like with The Magus, Warlock tricks The Goddess into thinking she accomplishes her goal, but really succeeds in exposing her crazy plan for what it is: crazy. In the end, The Goddess is also absorbed into Warlock's Soul Gem (alongside Magus), while Thanos destroys the Cosmic Egg.
As a footnote, Thanos delivers one Cosmic Cube to Mephisto in exchange for his help; however, the devil is tricked by The Titan as the Cube is not functional.