1- The Qur’an was not in a fully compiled form during the life of the Prophet (s). There was a copy of the Qur’an in the Prophet’s mosque, but it wasn’t fully compiled. It was more scattered pages put together. But it was still in book format.
2- As soon as the Prophet (s) passed away, Imam Ali (a) compiled those pages into one organized book. It took him about 3 days to do that.
3- During the time of Uthman, different versions of the Qur’an had appeared (due to different ways of writing the Arabic script), and so Uthman (after consulting Imam Ali and other companions) unified the versions. He destroyed other versions and kept one only.