When Ibrahim (as) famously left Hajar (as) with their baby son in the desert, she asked him if Allah commanded him to leave them. He said yes, so she said that she trusted Allah would take care of them. Her response to the situation illuminated a middle path between two extremes we commonly see.
One extreme is pessimism. A person may simply give up and lose hope. After scanning the horizon and seeing no food, water, or any sign of civilization, it would be easy to sit down and do nothing. People with a negative mindset will focus on all the things wrong in this situation - there's no food, we'll probably die here - and overwhelm themselves with hopelessness.
The other extreme is naive optimism. It is sitting there doing nothing while telling yourself everything will work out. Or perhaps to simply "envision" a better situation and hope it will arrive.
Hajar demonstrated what optimism looks like.
The action of her heart was to trust Allah and have faith that He would make a way out. The action of her limbs was to do everything in her control to remedy the situation. No food? Then she will run back and forth between mountains looking for something to give her child.
She set a precedent that embodies the prophetic tradition, "tie your camel, and then trust in Allah."
When it comes to the sunnah of the Prophet (s) we rarely talk about mindsets. The sunnah of optimism provides a playbook for dealing with the major and minor difficulties in our lives.
It's amazing to think that he was tested more than anyone else, and yet, his default demeanor was always smiling.
True optimism provides the resolve to deal with difficulty.
When we look back at the most difficult moments of our lives, we actually cherish them. Those hardships, failures, and scars are what made us into who we are today. They made us stronger and provided lessons so invaluable we'd never trade them for anything.
This is easy in hindsight, but harder to do in the moment - "Patience is at the first strike of calamity."
The prophetic example shows us how to cultivate a mindset of optimism.
He (saw) warned against giving up on people. "Whoever says the people are destroyed, he is the most destroyed amongst them (Muslim)." And Allah (swt) says in the Qur'an, "Do not lose heart or despair, and you will be superior if you are [true] believers (3:139)."
Despair is easy to feel almost by default. Every time we turn on our phones we are bombarded with headlines, photos, and videos of injustices that make it seem as if the world is going down the tubes. The lens of the believer necessitates understanding that our faith in Allah means knowing Allah is the source of all that is good, and He will never decree something in which the evil outweighs the good - even if that good is reserved for the akhirah.
The Prophet (s), even in the most dire circumstances, would look for excuses to be optimistic. When the Muslims set out for umrah, and were blocked by the Quraysh, the situation was tense. Negotiators kept coming but no agreement could be reached. Finally, the Quraysh sent Suhayl b. Amr, and the Prophet (s) took this as a good sign. The name Suhayl has a connotation of ease, and so the Prophet (s) announced to his companions that this was a good sign. Eventually, the treaty of Hudaybiyah was agreed upon - a victory in and of itself, even if it was unclear at the time as to how.
He even engineered the environment around him to be one that instills optimism. When he met someone from a place called the 'Valley of Misguidance', he renamed it the 'Valley of Guidance'. This shows us that the way we refer to things even has a subconscious effect on us. What is the subconscious effect, for example, of referring to one's spouse as "the old ball and chain" over and over again? When his (saw) grandson was born, Ali (ra) named him Harb (war). The Prophet (s) changed his name to Hasan (good).
He encouraged his companions to always be of those spreading good to others. He instructed them, "give glad tidings, and do not scare people away. Make things easy, do not make things difficult."
The most important optimism is the optimism in Allah. The Prophet (s) relates to us that Allah said, "I am as my servant expects me and I am with him as he remembers me." If you believe that Allah intends to make your life difficult, or that He is vengeful toward you (audhubillah), then that is what you will get. If you believe that Allah loves His creation, and intends what is best for them, and wants to forgive them - then you will find Allah (swt) as such.
When we inevitably encounter difficulty in our lives, we must tackle those problems head on and work our hardest to deal with them. We remind ourselves in those moments, that ultimately things will work out for the best, because we know that what Allah decrees for us is good and He will give us the strength and ability to make it through what we are dealing with.
"Our Lord, and burden us not with that which we have no ability to bear. And pardon us; and forgive us; and have mercy upon us (2:186)."