We have free will to choose right from wrong. Guidance only comes from Allah. We can only receive guidance if Allah permits. But Allah doesn’t just randomly guide people. We open our hearts, we create the proper conditions for guidance, then Allah delivers guidance to us. In other words, we prepare the prerequisites for guidance, and Allah grants us the actual guidance.