One reason could be his superior knowledge of magic. He might have found a way to counter the power of the Infinity Stones using his vast understanding of the mystic arts. For instance, he could have created a spell that made him invisible or immune to the effects of the snap.
Well, in certain fanfictions, Doctor Strange survives Infinity War because he has a hidden magical artifact. This artifact could have the power to shield him from the effects of the Infinity Stones. It might be something he discovered during his travels through different dimensions, and he uses it at the crucial moment to avoid being wiped out like the others.
The story of Dr Strange and the Dark Dimension is quite fascinating. He has to navigate the complex and dangerous realm of the Dark Dimension. There are all sorts of strange creatures and powerful magic there. And his struggle to keep the Dark Dimension from encroaching on our world while also dealing with the power - hungry entities within it makes for a great story. His ability to manipulate time and space within the Dark Dimension is also a very interesting aspect of this story.