General spoiler alert so I don't have to hide the whole question...
Towards the end of Avengers: Infinity War, Thanos uses the time stone to rewind time and reassemble the shattered mind stone.
We know that Thanos only retrieved the time stone moments ago on Titan.
We also know that using the time stone is not easy, and requires significant training and ancient knowledge, as noted in this Doctor Strange scene:
Mordo (referring to the time stone):
How did you learn to do that? Where did you learn the litany of spells required to even understand it?
I've got a photographic memory. It's how I got my M.D. and Ph.D. at the same time.
What you just did takes more than a good memory. You were born for the mystic arts.
Given the above, how does Thanos know how to use the time stone?