The purpose of acts of worship in Islam is to become aware of the presence of God. Worship, whether it be prayer, fasting, or alms-giving, is a step on the path toward the goal of attaining God's pleasure. If someone lives in their thoughts and actions with the consciousness of God, then they can hope for His blessings both in this world and in the hereafter.