In the beginning of The Infinity Gauntlet comics, Mistress Death brought Thanos back to life (based on what Silver Surfer told Dr. Strange). But, how did Thanos die in the first place?
Thanos is laid low by Adam Warlock and converted into granite by an unexplained power of the green Soul Gem. The mechanics of his petrification are unexplained since neither the Soul Gem nor Adam Warlock possessed such powers until that point.
- Thanos manipulates Adam Warlock into killing himself and eliminating a future threat (The Strange Death of Adam Warlock). Thanos does this to prevent the only true threat to himself, the power of the green Soul Gem from being used against him. Despite Thanos' fantastic might, he fears the Soul Gem's ability to strip a soul from their flesh and fears it might affect even him.
- Warlock battles Thanos and is killed by him. But before dying, a time-traveling version of Warlock arrives in the future to absorb his soul to prevent this future version of himself which was killed by Thanos from becoming an even greater galactic threat: The Magus.
Warlock returns to the past and from where Thanos is sitting, the threat of Warlock and the future threat of the Magus is now gone. Thanos proceeds to create his synthetic gem (the precursor to the Infinity Gauntlet) and sets out to continue his conquest of the galaxy.
Unfortunately for Thanos, even after Warlock's death, the Soul Gem which houses the spirit of Adam Warlock and everyone whose soul has been captured within, is roused to anger and converts Thanos in his moment of triumph against the Avengers into granite and a death-like slumber.
He wasn't exactly dead, but Thanos' previous semi-permanent defeat came in Marvel Two-In-One Annual #2.
Marvel Wikia explains what happened:
Over powered, the heroes prove unable to defeat Thanos until Spider-Man manages to free the Soul Gem, causing the soul of Adam Warlock to appear from it and turn Thanos into stone. After rejoicing over their victory, the heroes have a funeral and bury Adam Warlock on an asteroid in space. While Adam's soul finds peace within the Soul Gem, Thanos finds himself in a living hell made of stone.
Thanos was out of commission for 13 years, until he was restored during the Rebirth of Thanos storyline.
Thanos's death occurred in a story titled "Death Watch" that spanned Avenger Annual #7 and Marvel Two-in-One Annual #2. Specifically he was turned to stone in Marvel Two-in-One Annual #2 by the disembodied soul of Adam Warlock.
He was returned to life by Mistress Death in Silver Surfer #34. That story then led directly into Thanos Quest where Thanos collected the six Infinity Gems. The Infinity Gauntlet then spun directly out of that.