Remember that the outcome of our actions are in the Will of Allah (سبحانه وتعالى) and nothing else. Our efforts do not convey a certainty towards the outcome whatsoever.
There are times where you study, study, study for a test and only score a 60. Then there are times you may just briefly glance over your notes the night before and score an 80.
Is it by luck?
No.
This shows that Allah (سبحانه وتعالى) is The One in control. We should put our efforts in, but know that the result is in the Will of Allah (سبحانه وتعالى). It’s miraculous, because there will be times (and I know many of my classmates have seen this) that we write a test, expect a 60, but actually score an 80. Thats Allah (سبحانه وتعالى) at work, and know that it is Allah (سبحانه وتعالى), and nothing else.
Times come where we perceive something to be bad for us, but Allah (سبحانه وتعالى) sees goodness it in. And there are times where we perceive something to be good for us, but Allah (سبحانه وتعالى) finds badness in it. We do not know what is best for us, and so it is always important to look to Allah (سبحانه وتعالى) for everything we do, and put our trust in His judgment. For who knows better then The All-Knowing, The Wise?