All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Nothing in this universe can happen except by the will of Allah; what He wills happens, and what He does not will can never happen. Allah Almighty Says (what means): {...had He so willed, He would indeed have guided you all.} [Quran 6:149] And, {...If Allah had willed, they would not have fought against one another, but Allah does what He intends....} [Quran 2:253] He Almighty also Says (what means): {And you do not will except that Allah wills. Indeed, Allah is Ever-Knowing and All-Wise.} [Quran 76:30]
Verses that have the following meaning: "Indeed, Allah guides not the wrongdoing people.", "Indeed, Allah does not guide he who is a liar and [confirmed] disbeliever." Such verses mean that Allah does not guide the one whom He knew in His Infinite Knowledge will die as a disbeliever or as an oppressor. However, those whom Allah Almighty wills for them to be guided before they die, He Almighty facilitates guidance for them.
Allah Knows best.