Allah is perfect but what is confusing me is that it took Allah 6 days to create the Heavens and the Earth, he didn’t create the two instantly.

Answer

Respected Brother-in-Islam

Assalaamu Alaykum Wa Rahmatullaahi Wa Barakaatuhu

The commentators explain the wisdom behind the creation of the heavens and
the earth over a period of six days was to show man that he should not be
hasty in his affairs but rather he must be cautious and meticulous.

and Allah Ta’ala Knows Best

Mufti Ebrahim Desai
FATWA DEPT.

Source