My question is : Ayats were revealed to our beloved Prophet (pbhahp), but who wrote them into Qur’aan?

There were various companions who used to write the verses down, and amongst them was also Imam Ali (as) who used to write them down.

Prophet (sawa) used to check they had written it correctly.