I understand after each punishment He tells us to be good, do good so we can achieve His mercy. But isn’t faith in Him based on pure love? If I fear His punishment at all times, how could my love be unconditional for Him? I understand if I don’t want to displease God, I have to avoid the bad things that He forbade, because that is for my own good. But why would I have to be always so afraid? In a book of love and mercy, it’s hard to see such punishments, because as for me, if I love God, I would aim to refrain from those things that may hurt me.
The punishments of Allah are consequential not conventional. In other words, as the Quran mentions, they are the consequences of our actions, or as some believe they are the embodiment of our actions returned to us. Its pain is to change something in the heart and soul so that the evil doers can have a change of heart and attitude and be capable to accept the mercy and blessing of God and go out of hell.