The Cow - 2:164
In the creation of the heavens and the earth, and in the alternation of night and day, and in the ships that sail in the ocean for the benefit of mankind, and in Allah sending down water from the sky and reviving the earth after its death, and in every kind of living creature He spreads therein, and in the winds and the swirling of the clouds between the sky and the earth, there are indeed signs (lessons and proofs) for a people who use their reason.
For what purpose were the heavens and the earth created?
Prophet Hud/11:7
"He it is Who created the heavens and the earth in six days, to test which of you is the best in work. His sovereignty was over the waters. Nevertheless, if you say to the disbelievers, "You will be resurrected after death,"they will say, "This is only clear magic."
The Prophets/21:16
We did not create the heavens and the earth and all that is between them for play.
The Arabic Letter Sad/38:27
We did not create the heavens and the earth and all that is between them in vain; that is the delusion of those who disbelieve. Woe to those who disbelieve, for they put themselves into the Fire.
The Kneeling/45:22
Allah created the heavens and the earth for a purpose, so that every soul may be recompensed for what it has earned, without injustice.
The Cave/18:7
We have adorned the earth with its materials to test who will be righteous.
The Sandhills/46:3
We did not create the heavens and the earth and all that is between them except for a purpose and for a definite term. Those who disbelieve do not heed the warning.
The Prophets/21:35
Every soul will taste death. We test you with good and evil events as a test, and to Us is your return.
The Kingdom/67:2
He it is Who created death and life to test which of you is best in deeds. He is the Exalted, the Forgiving.
The Family Of Imran/3:129
All that is in the heavens and the earth belongs to Allah. He forgives those who deserve forgiveness and punishes those who deserve punishment. Allah is Forgiving, Merciful.