If they do die and Marvel later want to recast these characters, then there are ways to bring each of them back to life.
Iron Man - Injected himself with Extremis before his death and has been around but just in hiding and ultimately proud that he faked his death.
Black Widow - Backup clone with all her memories.
Hulk - Radiation in his body caused it to resurrect spontaneously
Captain America - His death locked his soul into a fixed point in space and time and he'll be brought back to the present by using the quantum realm as a means of transporting him from the exact moment of his death.
Thor - Rebirth of Asgard itself.
War Machine - Tony Stark finds his corpse and brings him back from the dead with cybernetic parts.
Hawkeye - Reality itself is altered through time travel by Scarlet Witch in a way which brings Clint back from the dead.
Ant-Man - Same as Hawkeye. Wanda can do some amazing things.
All of these things happened in the comics.
Spider-Man, Loki, Wasp and Vision have also died and come back but their deaths will be reversed as will those of the Guardians, Scarlet Witch, Falcon, Black Panther, Winter Soldier and Doctor Strange since Loki, Winter Soldier, Vision, Scarlet Witch and Falcon are getting spin-offs on TV while film sequels for Spider-Man, Doctor Strange and Black Panther are all getting sequels in various stages of production. If they're coming back, then so's Wasp so it's a moot point to think of ways to resurrect them.
In all honesty, I think we'll get the New Avengers with Shang-Chi, Crystal, Valkyrie, Sersi and others for a while. I also feel like after Guardians 3, we'll get a new team with Adam Warlock, Phyla-Vell, Darkhawk, Moondragon, Nikki Gold and Nova as the roster.
And we need the Avengers to have their numbers decimated in order for the Thunderbolts to form. Zemo is likely to lead a new team of anti-heroes with Shocker, Bullseye, Ghost and others to be the new "heroes" the world needs. That alongside the Fantastic Four returning from space in a changed form while Charles Xavier assembles the X-Men.
I feel like Phase 4 needs to end with Kang's arrival forcing the Avengers to return. I'd title the film Kang Dynasty but use the tagline Heroes Return and the catalyst for them all coming back from the dead would be the newborn Franklin Richards subtly manipulating reality as a means of getting them all back at once. The MCU would have time to introduce new characters and new stories while not rushing the recasts or clogging their schedule with older characters.