Thanos is defeated and killed in various ways in the comics. Sometimes it's through the combined efforts of superhero teams, and other times it's due to specific circumstances and storylines.
Thanos dies in comic when the heroes find a way to overcome his immense power. It could be a weakness exploited or a surprise twist in the story that leads to his downfall.