Isaiah 1:15
One of the saints once said: The following I have taken as a sign. When a solitary does not serve God in the right way, and is not zealous in His works, God certainly will send him a temptation to occupy his thoughts, lest he be wholly idle and, by complete idleness, his mind turn aside to thinking of the things of the left hand. But if he is not willing to think of excellence, the influence of the temptations will cause him to think of it and not to think of idle things. This God does with every man who loves Him. When He sees that he begins to disdain His works, he sends a heavy sorrow in or...der to make him wise and to chastise him. Therefore, when such people call to Him, He does not pay attention, nor does He hasten to free them, till they have become weary and know that they have to bear these things on account of their neglect. ‘When ye spread forth your hands, I will hide mine eyes from you; yea, when ye make many prayers, I will not hear. Even if this was said to others, still it is certainly applicable to those who leave the way. But if God is so compassionate, why do we then so frequently knock at His door in trouble and pray, and yet He turns away from our prayer? He says: Behold, the Lord’s hand is not shortened, that it cannot save; nor His ear heavy, that it cannot hear. But your iniquities have separated between you and your God, and your sins have hid His face from you, that He will not hear.
Source: Mystic Treatises, Chapter 5