Our thoughts have a powerful ability to determine our feelings and emotional states and ultimately affect how we behave, for better or worse. Islam teaches us to direct the act reflection (tafakkur), or deep thought, towards the signs of Allah, the names and attributes of Allah, to his blessings and wonders, to hope in the Hereafter, and to optimism. By controlling our thought processes in a positive manner, we can increase the effectiveness of our prayers and worship as well as relieve ourselves from the anger, depression, and anxieties that worldly thoughts induce.

Contrary to popular belief, we have control over which thoughts we choose to follow. We may not have a choice over which particular thought occurs initially in our minds at a given time, but we do have a choice to either ignore it or pursue it.

Our voluntary thoughts are nothing more than inward statements. Hence, the rule is that we should only engage good thoughts or keep our minds silent.

Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said:

Sometimes Satan will throw evil suggestions into our minds. These suggestions have no power over us unless we choose to act on them. If we follow an evil or negative train of thought, then it will lead us to a terrible end.

Thus, when we find ourselves caught up in a bad line of thinking, we need to immediately replace these negative thoughts with positive inward statements to cancel their effects.

Abu Dharr reported: The Messenger of Allah, peace and blessings be upon him, said:

Positive thoughts are those that produce good feelings, good deeds, peace of mind, gratitude, tranquility, contentment, and other positive emotional states. These are truthful thoughts about Allah, hope in the Hereafter, the prophets, our blessings, good deeds, and so on. They produce wisdom and enlightenment in the heart.

Negative thoughts are those that produce bad feelings, anger, envy, jealousy, hatred, anxiety, depression, and other negative emotional states. These are thoughts about the world, our wealth, our status, people we do not like or who have wronged us, and so on. The cause of these thoughts is an attachment to the delusions of worldly and materialistic life that cloud the heart and prevent its purification.

Thought upon the world is a veil over the Hereafter and a punishment for the people. Thought upon the Hereafter produces wisdom and life in the heart. Whoever looks to the world as his protector will come to accept its delusions.

Source: Hilyat al-Awliyā 14447

Not all thoughts about the world are evil. Thinking about something Allah blessed us with in the world is good. And we have a duty to take care of our worldly affairs, meet our work obligations, pay our bills, fulfill our trusts, and so on. We should think about these things in so far as they are necessary and beneficial.

For example, we may need to think about how we are going to complete a work project. But perhaps at work someone said a mean word to us or did something to annoy us. If we constantly dwell upon that negative interaction, it will only cause harm to us and produce no benefit. It is an unnecessary worldly thought and should be dismissed.

In fact, a step on the road to excellence in Islam is learning to think about only those things that should concern us.

Ali ibn Hussein reported: The Messenger of Allah, peace and blessings be upon him, said:

إِنَّ مِنْ حُسْنِ إِسْلَامِ الْمَرْءِ تَرْكَهُ مَا لَا يَعْنِيهِ

Verily, part of perfection in Islam is for a person to leave what does not concern him.

The most beneficial remedy is that you preoccupy yourself with thoughts of what should concern you and not those that should not concern you. Thinking about what does not matter to you is the door of every evil. Whoever reflects upon what does not concern him, then he will miss what does concern him.

Source: al-Fawā’id 1/175

This means busying ourselves with worldly thoughts only to the extent necessary, and also learning not to worry about matters beyond our circle of influence or control. If we constantly worry or get upset by things we cannot change, that will take our attention away from what we can change.

After understanding the effects of positive and negative thoughts, we then need to direct our thought processes towards positive trains of thought and learn to dismiss negative thoughts before they take us into a downward spiral. Many of the Prophet’s companions considered the skill to direct thought in a positive way as the enlightenment of true faith.

Thinking about the blessings of Allah is itself an act of worship that leads to gratitude, contentment, and happiness. It takes no significant effort from us and yet it produces great results in our lives.

All of this points to the fact that the believers should be optimistic and not pessimistic or cynical. There are no omens in Islam (or signs that predict the future), but the believers are always expecting the best from Allah even if they do not know exactly how it will be.

Abu Huraira reported: The Prophet, peace and blessings be upon him, said:

لَا طِيَرَةَ وَخَيْرُهَا الْفَأْلُ

There are no omens, but the best of it is optimism.

They said, “O Messenger of Allah, what is optimism?” The Prophet said:

Positive thinking and optimism are most important as they relate to our prayers, supplications, and acts of worship. A prayer or supplication that is offered with certainty that Allah will answer is far more effective and beneficial than a weak prayer. For this reason, the Prophet told us to pray to Allah in the certain knowledge that he will answer.

Anas ibn Malik reported: The Messenger of Allah, peace and blessings be upon him, said:

The meaning of determination is to be persistent in the supplication and to affirm that what is asked will occur.

Source: Fatḥ al-Bārī 5979

And An-Nawawi writes:

هُوَ حُسْنُ الظَّنِّ بِاَللَّهِ تَعَالَى فِي الْإِجَابَةِ

It is to have good expectations (ḥusn al-ẓann) that Allah the Exalted will answer you.

Source: Sharḥ Ṣaḥīḥ Muslim 2678

Once we make a supplication, we should affirm it in our hearts and minds that Allah has without a doubt already heard and answered us. Let the prayer sink into the bottom of your heart and penetrate your subconscious mind.

Sometimes the answer does not come the way we would expect. But as long as we pray for good and expect good, the answer has already been fulfilled even if we do not know how.

Abu Sa’eed Al-Khudri reported: The Messenger of Allah, peace and blessings be upon him, said:

There is no Muslim who supplicates to Allah without sin or cutting family ties in it but that Allah will give him one of three answers: he will hasten fulfillment of his supplication, he will store it for him in the Hereafter, or he will divert an evil from him similar to it.

As long as we continue praying and supplicating, the answer is sure to come even if it is stored for the next life. In contrast, we are in danger of having our prayers unanswered if we get frustrated or stop praying altogether.

Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said:

Many of us do not have our prayers answered because we do not pray in a good manner, we pray for sinful things, we do not expect good from Allah, or we simply give up. In this respect, the Prophet is the best role model for us to learn how to pray and what to pray for. The real secret of prayer, though, is that we will get good from Allah to the measure that we expect good from him.

Abu Huraira reported: The Messenger of Allah, peace be and blessings on him, said:

Allah says: If he thinks good of me, he will have it. And if he thinks evil of me, he will have it.

Musnad Aḥmad 8833, Grade: Sahih

Our prayers need to be accompanied with certainty and conviction that our good expectations will be fulfilled. We have to constantly reaffirm and reinforce our prayers with the positive thoughts that Allah heard us and has already answered us in the best manner. Thinking well about Allah in this way is another step on the road to excellence in Islam.

Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said:

إِنَّ حُسْنَ الظَّنِّ بِاللَّهِ مِنْ حُسْنِ عِبَادَةِ اللَّهِ

Verily, thinking well about Allah is a part of excellent worship of Allah.

In sum, Islam teaches us to direct our thoughts towards what is good and to ignore bad thoughts. Like outward statements, thoughts we pursue are simply inward statements that should be good or at least neutral. If we entertain a bad thought, we should follow it with several positive inward statements to cancel its effect. Positive thinking should lead to an optimistic outlook and good expectations in Allah and his mercy. These good expectations are the inner secret that makes our prayers and worship most effective and fulfilling.