Why Did Dr. Strange Give Thanos the Stone in ‘Infinity War’?

Before Thanos arrives, the group begins formulating a plan to defeat him. Doctor Strange uses the Time Stone to view over 14 million alternate futures to determine the outcome of their battle but is unsettled to see only one of them showing the Avengers victorious.

Knowing this, Doctor Strange starts to help the others execute a plan that almost takes Thanos out. Unfortunately, nothing can stop the warlord, who goes as far as to nearly kill Tony Stark — it’s at this moment that Doctor Strange decides to give up the Time Stone.

Source: https://www.distractify.com/p/why-did-dr-strange-give-thanos-the-stone