The Prophet (pbuh) advised a person who is touched by something from Satan to mention Allah and to recite His Name and seek refuge with Him from Satan, for that is more beneficial for him and more exasperating for Satan. The Prophet (pbuh) said, "Verily, when the slave curses Satan, he says, 'Verily, you are cursing one who is (already) cursed.' All such statements make Satan happy and he says "The son of Adam knows that I have defeated him by my power". And this lends support to him in his misguidance.
If calamity befalls you, refrain from saying "If only I had done such-and-such", as this implies in it that if the matter had been planned by you, then the outcome would have been other than what Allah has decreed; and the occurrence of something other than what has been decreed is impossible, so this speech includes untruth, ignorance and impossibility.
The Prophet (pbuh) said: "Verily, it opens up (the door to) the deeds of Satan". (Narrated by Muslim and Ibn Majah). Instead it is more befitting of a Muslim to say, "Qaddarallahu Wa Ma Shaá Fa'ala" which means, "Allah has ordained and as He willed, He has done."
This is because lamenting over what has been lost does not benefit the believer nor does it change what has already occurred, and the word 'if' doesn't solve his problem either. By wishing for something whose occurrence is not to be hoped for, is simply helplessness and Allah censures helplessness, because it opens the door to Satan. But He loves intelligence and resourcefulness, which is to undertake the means (of achieving one's aims) and this opens the doors to goodness, and after you do this, if something gets the better of you, you should say: "Hasbiyallahu Wa Ni'mal-Wakeel". [Narrated by Abu Dawud and Ahmad]
The Prophet (pbuh) sought refuge with Allah from helplessness and laziness, for they are the key to every evil - and anxiety, depression, cowardice, miserliness, the burdensome debt and the oppression of men result from them. And the sign of this is lauw (if), for the one who wishes that Allah's Qadar were different is among the most helpless of people and the most bankrupt. The root of all sins is weakness or helplessness, because the slave is unable to undertake the means of achieving obedience and the means which keep him far away from acts of disobedience, and that form a barrier between him and them.
If a slave delays performing righteous deeds or performed them imperfectly, it would be either due to inability on his part - and this is helplessness, or it would be that he was able to do it, but he did not want to do it - and this is laziness.And the result of these two characteristics is that he would miss every good thing and attain every evil.
The Prophet (pbuh) said, "I seek refuge with you from "Al-Hamm" (anxiety) and "Al-Hazn" (sorrow)."
Anxiety and sorrow weaken the will and enfeeble the heart and form a barrier between the slave and striving to achieve what is beneficial for him. When something which is disliked afflicts the heart, the cause of it is either something which has already occurred, in which case, it results in sorrow, or else it is expected to occur in the future, in which case, it gives rise to anxiety - and both of them are from helplessness, because that which has already occurred cannot be dispelled by sorrow, but rather by acceptance, praise and thanks (to Allah), patience, perseverance and belief in Allah's Qadar. And that which is yet to happen cannot be repelled by anxiety for either there is a solution for it, in which case, he is able to do it, or there is no solution, in which case, he is unable to do it. And he should take on the garments of Tawheed and Tawakkul and display acceptance of Allah as his Lord.
Tawakkul (dependence on Allah) and Al-Hasb (declaring that Allah is Sufficient) without undertaking the measures which have been commanded is pure weakness and helplessness, even though there may be an element of Tawakkul in it. It is not fitting that the slave should let his tawakkul be in the form of helplessness, nor that he should claim that his helplessness was in fact tawakkul; instead he should make his tawakkul one of the necessary measures, without which one's aim will not be achieved.
Whatever situation a slave finds himself in, it is Allah who places him in it and it is thanks to Him and His Wisdom and He does not forbid the slave from any right which is his, rather He prevents it in order that he may implore Allah through the deeds which He loves and then He gives him. It is a means for the slave to return to Him and strengthen him through humility towards Him, to make him independent (of people) through his need for Allah, to restore him by submission before Allah, to raise him to the noblest position and to show him the Wisdom in His ability and the Mercy in His Might. Truly, His forbiddance is in fact giving and His Punishment is in fact discipline. When a person is prevented from something, it becomes a gift bestowed on him, while whoever busies himself with what was bestowed upon him, it becomes a prevention for him from the reward of the Hereafter.
Allah the Most High says:
"And whosoever fears Allah and keeps his duty to Him, He will make a way for him to get out (from every difficulty). And He will provide him from (sources) he never could imagine. And whosoever put his trust in Allah, then he will suffice him." [Qurán 65:2-3]
"So fear Allah. And in Allah let the believers put their trust." [Qurán 5:11]
[Taken from: Provisions for the Hereafter, by Imam Ibn Qayyim Al-Jawziyyah]