Allāh the Most high said:
يَا أَيُّهَا الَّذِينَ آمَنُوا كُتِبَ عَلَيْكُمُ الصِّيَامُ كَمَا كُتِبَ عَلَى الَّذِينَ مِن قَبْلِكُمْ لَعَلَّكُمْ تَتَّقُونَ ﴿١٨٣﴾
"O you who believe fasting has been prescribed for you like it was prescribed for those before you, so that you may become pious and righteous"
Indeed, fasting is from the greatest means of attaining piety and righteousness because within fasting is the compliance with Allah's orders and the avoidance of his prohibitions. The angles in which taqwá (piety and righteousness) are found within fasting are as follows:
Taken from: Taysīr al-Karīm al-Raḥmān by al-Imām Al-Saʿdī (d. 1376 AH)
Translated by Shaykh Uways al-Ṭawīl