Ghazali's major contribution lies in religion, philosophy and Sufism। A number of Muslim philosophers had been following and developing several viewpoints of Greek philosophy, including the Napoleonic philosophy, and this was leading to conflict with several Islamic teachings. On the other hand, the movement of Sufism was assuming such excessive proportions as to avoid observance of obligatory prayers and duties of Islam. Based on his unquestionable scholarship and personal mystical experience, Ghazali sought to rectify these trends, both in philosophy and Sufism.
In philosophy, Ghazali upheld the approach of mathematics and exact sciences as essentially correct. However, he adopted the techniques of Aristotelian logic and the Neoplatonic procedures and employed these very tools to lay bare the flaws and lacunae of the then prevalent Neoplatonic philosophy and to diminish the negative influences of Aristotelianism and excessive rationalism. In contrast to some of the Muslim philosophers, e.g., Farabi, he portrayed the inability of reason to comprehend the absolute and the infinite। Reason could not transcend the finite and was limited to the observation of the relative. Also, several Muslim philosophers had held that the universe was finite in space but infinite in time. Ghazali argued that an infinite time was related to an infinite space. With his clarity of thought and force of argument, he was able to create a balance between religion and reason, and identified their respective spheres as being the infinite and the finite, respectively.
In religion, particularly mysticism, he cleansed the approach of Sufism of its excesses and reestablished the authority of the orthodox religion। Yet, he stressed the importance of genuine Sufism, which he maintained was the path to attain the absolute truth.
He was a prolific writer। His immortal books include Tuhafut al-Falasifa (The Incoherence of the Philosophers), Ihya al-'Ulum al-Islamia (The Rivival of the Religious Sciences), "The Beginning of Guidance and his Autobiography", "Deliverance from Error". Some of his works were translated into European languages in the Middle Ages. He also wrote a summary of astronomy.
Ghazali's influence was deep and everlasting. He is one of the greatest theologians of Islam. His theological doctrines penetrated Europe, influenced Jewish and Christian Scholasticism and several of his arguments seem to have been adopted by St. Thomas Aquinas in order to similarly reestablish the authority of orthodox Christian religion in the West. So forceful was his argument in the favour of religion that he was accused of damaging the cause of philosophy and, in the Muslim Spain, Ibn Rushd (Averros) wrote a rejoinder to his Tuhafut.