Praise be to Allah, and may Allah’s peace and blessings be upon the Messenger of Allah, his family and his companions.
As to what follows:
In response to your question, we say, and with Allah Almighty lies all success:
There is no doubt that sins are among the greatest causes for obliterating the insights and hearts of people, which also result in the sealing and veiling which has been mentioned. Allah Almighty said:
“Allah has set a seal upon their hearts and upon their hearing, and over their vision is a veil. And for them is a great punishment.” [Al-Baqarah 2:7]
In contrast, taqwa is life for the hearts. Allah Almighty says:
“O you who believe, if you fear Allah He will grant you a criterion.” [Al-Anfal 8:29]
Meaning, “If you have taqwa of Allah by which you carry out His commands and refrain from His prohibitions, He will grant you this criterion to distinguish between truth and falsehood.”
As for what you have quoted from Ghazali that, “The life of this world is an intermediary phase to attempt to perceive Allah Almighty,” in order to pass a judgment on this statement and see the extent of its validity, I need to examine the actual text of his words. Whatever the case may be, the life of this world is the phase of man’s existence after non-existence. Allah Almighty said:
“Has there not come upon man a period of time when he was nothing to even be mentioned?” [Al-Insan 76:1]
Thus, Allah Almighty brought him into existence in this life to worship Him. He Almighty said:
“And I did not create the jinn and mankind except to worship Me.” [Al-Dhariyat 51:56]
The fruit of Allah’s worship is in getting to know Him, the Exalted and Almighty; and there is no doubt that this is among the greatest of purposes. That is why the Prophet (peace be upon him) said, in what Tirmidhi and Ibn Majah have reported from Abu Hurayrah (may Allah be pleased with him), “This world is cursed and what is in it is cursed, except the remembrance of Allah and what is conducive to that, or one who has knowledge or who acquires knowledge.” What is meant by “the world” here is everything that preoccupies the slave from that which he was created for, which is the worship of Allah, the Exalted, His oneness and knowledge of Him.
So if Ghazali meant by his statement, “It is an intermediary phase to perceive Allah Almighty,” that which we have mentioned, then the meaning is correct. However, using the term “perception” as far as Allah Almighty is concerned is incorrect, because perceiving Allah, the Exalted and Almighty, is impossible. He Almighty said:
“Vision perceives Him not, but He perceives all vision.” [Al-An`am 6:103]
This is with regards to visual encompassment and perception, even though the believers will see Allah, the Exalted, in the hereafter, but they will not perceive Him and encompass Him in totality; and there is no contradiction between affirming sight and negating perception, as perception is more specific than sight, and negating perception does not necessitate negating sight. We see the sun but cannot perceive it due to the intensity of its blaze and shine. Thus, a thing may be seen but not necessarily perceived. As for knowledge perception, nobody can acquire it regardless of who he is. Allah Almighty said:
“But they will never encompass anything of His knowledge.” [Taha 20:110]
Here is the best of creation and the most knowledgeable of them regarding Allah, our Messenger Muhammad (peace be upon him), saying in his du`a which has been reported by Muslim, “I cannot enumerate Your praise; You are as You have praised Yourself.” So much so that he (peace be upon him) will be inspired with such praises that he was previously ignorant of; that being when he intercedes for creation before Allah Almighty to bring forth the judgment on the plains of the Resurrection. He (peace be upon him) said in the hadith of Anas (peace be upon him) mentioned by Bukhari in the story of the Great Intercession, “Then I will be granted permission [to intercede], and then He will inspire me to praise Him with such praises as I do not know right now. So I will praise Him with those praises.”
The point is that perceiving Allah Almighty by vision and knowledge is impossible. So glory be to You O Allah, Possessor of glorifications; perceptions do not perceive You, nor do illusions reach You.