One way could be through some kind of time - related magic. Maybe Doctor Strange finds a way to manipulate time even more precisely than he did in the movie. He could create a special time loop that spares Tony's life while still achieving victory over Thanos. Another possibility is that Pepper, using her own intellect and some Stark technology she's been secretly working on, manages to reverse the effects of the Infinity Stones on Tony at the last moment.
A common plot involves Tony being resurrected by some kind of magic or advanced technology. For example, the Wakandans could have a secret method of bringing the dead back to life that they use on Tony. Or, in the Quantum Realm, there could be a phenomenon that reverses death, and Scott Lang discovers it and uses it to save Tony. Also, some fanfictions have Tony's soul being saved by a powerful being like the Sorcerer Supreme and then being put back into his body.
Morgan Stark, Tony's daughter, could be a central character. Her existence might be what drives the other characters to find a way to bring Tony back. Rhodey, as Tony's long - time friend, would surely be involved in any attempt to save him. And there could also be appearances from characters like Nick Fury, who has a knack for getting involved in important events and might offer some resources or knowledge to help Tony survive.
One possible plotline could be that Tony Stark uses his genius to find an alternative way to defeat Thanos without sacrificing himself. Maybe he discovers a new element or technology during the final battle that turns the tide. Another plotline could involve time travel having unforeseen consequences that bring Tony back to life in a different timeline, and he has to find his way back to his original one.
One great Peter and Tony Endgame fanfiction is 'A New Beginning'. It focuses on how Peter copes with Tony's sacrifice in Endgame and his journey to become a better hero in his honor. Another is 'The Legacy of Iron Man and Spider - Man' which shows their bond even after Tony's death, with Peter carrying on his ideals.
In a fanfiction where Tony didn't die, he could continue to be a mentor to the new generation of Avengers. He would use his genius intellect to develop even more advanced technology to protect the Earth. Maybe he'd finally have the time to focus on his family life with Pepper and their daughter, while still being involved in superhero affairs on a more strategic level.
If Tony didn't die, the story would be drastically different. For one, the Avengers would still have his leadership and resources. His presence would change the dynamic during the post - Endgame events. They wouldn't be mourning his loss, but instead, be planning new strategies with him at the helm.
Well, if Tony wasn't there to assist, the balance of power would have shifted greatly in Thanos' favor. It's likely that the heroes would have faced more losses and the fate of the universe would have hung in the balance in a much more uncertain way.