Fasting makes a person conscious of Allāh. When a person is conscious of Allāh, he will be cautious of Allāh. This is Taqwá.