One of the important teachings of Islam is to be truthful. It is no doubt relevant when dealing with people/society. However does it apply equally in the realm of our psychology & subsconscious mind? In Psychology,it is a well known fact that one can change oneself thru positive self-affirmation & visualisation .It is believed that the self-affirmations to the subconscious mind is best done in an “already achieved mode”. For example,a student who is weak in mathematics and wish to improve on it should say the self-affirmations as “I am excellent at mathematics” & also visualize himself as ALREADY being good at Maths repeatedly(even though he is not that good at the moment). Or a person who is a coward could reprogram his mind by saying to himself,” I am brave”,etc. This is so that the subconscious mind is set with the positive intended goal and thus will program the whole body with the message. But the question is that such self-affirmation is not the truth (or not the truth yet). When he is telling himself that he is ALREADY being good at Maths, he is actually “lying “ to himself. But is it acceptable in Islam in this case? In surah al-Anfaal verse 43 & 44 describes how Allah makes the Muslims see the enemy as small in number whereas they are actually LARGER than the Muslims. So it seems it is allowable to “lie” to oneself in a positive way? Also the concept of “husnul zann” of giving “70 excuses” when dealing with Muslims show that we prefer to see the positive aspects rather than the real truth?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
It appears –Allaah Knows best –that what you mentioned is not a lie. Rather, this is like the good optimism which the Prophet loved, as confirmed in the authentic Sunnah. He referred to it with the term 'good word'.
The scholars said: “The good word is that which is said in regard to what the person aspires for and which makes him happy.” There is no doubt that this has good consequences on one's soul and mind, and this positively affects the person's conduct.
The verse which you mentioned in the question reflects this meaning, which is the positive effect on the soul, as this contributed to make the Muslim army firm and steadfast [as this led them to be victorious in the battle].
You can search for fatwa through many choices