In Avengers: Endgame, we learn that
Thanos destroys the Infinity Stones. And then, the Avengers go back in time (perhaps to different realities) in order to gather Infinity Stones. Once they finish their work with these Infinity Stones, they are taken back to their respective realities.
So, in the main timeline, where they bring back the dusted characters, there are no Infinity Stones.
But, consider the Time Stone. Doctor Strange and his sanctum swore to protect the Time Stone.
Then why did Doctor strange give away the Time Stone
if Thanos was going to destroy it?