It is important to remind ourselves that we don’t control all the variables in the world. God does. He is the Wise, the All-Knowing. Sometimes our limited human faculties are not able to comprehend His wisdom behind what happens to us and to others, but knowing that He is in control and that as human beings we submit to His Will, enriches our humanity and enhances our obedience (Uboodiah in Arabic) towards him. Read the story of the encounter of Moses with the mysteries behind God’s decision (Quran: 18:60-82). Familiarize yourself with God's 99 Names, which are also known as His Attributes. It is a powerful way of knowing Him.
"God-there is no deity save Him, the Ever-Living, the Self-Subsistent Fount of All being. Neither slumber overtakes Him, nor sleep. His is all that is in the heavens and all that is on earth. Who is there that could intercede with Him, unless it be by His leave? He knows all that lies open before men and all that is hidden from them, whereas they cannot attain to aught of His knowledge save that which He wills them to attain. His eternal power overspreads the heavens and the earth, and their upholding wearies Him not. And He alone is truly exalted, tremendous." (Quran 2:255).
The Prophet recommended reading this verse, known as Ayat al kursi, after each prayer, Allah’s peace and blessings be upon him. Once Ali, may Allah be pleased with him, approached the Prophet during a difficult time and he found the Prophet in Sajda, where he kept repeating "Ya Hayy Ya Qayyum", words which are part of this verse.