The ending of Infinity War in the comic is quite complex and involves multiple twists and turns. But in a nutshell, the heroes manage to overcome Thanos' tyranny through a combination of teamwork and strategic planning.
The comic version of Infinity War concludes with a resolution that sees the heroes rise above the odds. Thanos is defeated, but not without significant challenges and losses along the way. It's a thrilling and emotional finish.