Thanos was using the power of four stones at the time, two of which could directly counter Dr. Strange - Space and Reality. Strange traps Thanos in a timeloop, Thanos just uses the Space stone to get back to wherever he wants to. Strange uses illusions on him, Thanos uses the Reality stone to counter it (which he does, when he picks the real Strange out of his many duplicates when they fight). Better yet, Thanos uses both at once and sends Strange off to another galaxy in some warped reality of his own making.
Failing that, he just straight nukes him with the Power stone, they way he would nuke Captain Marvel in Endgame.
And finally, being in the possession of the Soul stone, you cannot kill Thanos.
After viewing 14,000,605 alternate outcomes, Strange would've seen Thanos counter everything he could've tried to do.
Even with 4/6 Stones, Thanos was already far too powerful for any one of the Avengers to take down with the possible exception of Vision using the Mind stone to manipulate Thanos.