They are typically just written out of the conflict. In this case I assume that you are talking about Captain Marvel whom I believe is always needed on other planets in other galaxies except for the rare occassion when the writers needs a deus ex machina.
Same for the Green Lantern Corps. They are always needed but there's far too few of them so 99.999% of the time the heroes in these stories kind of hold the front until a GL shows up and beats the threat relatively easily.
I quite enjoyed that universe for a bit of time but the ever-inflating (and absurd) power levels and lack of actual stakes eventually ruined it for me. As it did with most mainstream superhero movies.
One was left wondering how there could be any further movies with this person available to fly through anything.