Believing in predestination (qadar) and free will is one of the six articles of faith and possibly the concept that our fallible brains find the most difficult to understand. Here is a pretty good explanation of how qadar and free will work together:
Uploaded by YouTuber khalifahklothing
I have found that the best way to understand this subject is to make sure you fully understand some basic Islamic concepts:
1. Your existence is to worship Allah (SWT), no more no less.
2. What differs you from animals and angels is your right to choose to worship Allah (SWT), or not.
3. Without Allah's Will, your right to choose would not and cannot exisit.
4. You are given the choice because Allah (SWT) willed for you to have it and He willed for you to have it because He decreed for the creation of a being who has the ability to freely accept or reject it's Creator. Angels accept their creator through knowledge but do not do so freely and have no animalistic desires to fight against. Animals have no higher levels of knowledge or logic but worship Allah (SWT) innately without choice and without being required to fight their animalistic desires. Only man and jinn have been given BOTH logic and desires. We have a God-given right to choose which one we follow.
5. In this life, we choose and Allah (SWT) allows our choice to come about. He knows what choices we will make and He allows us to make them. In short, we actively and freely MAKE our choices in life based on our desires and intentions, by which we will be judged.
6. Allah (SWT) loves those who choose to do good and worship Him and Him alone - some people use this for the argument "if God wants us to do good why couldn't He just make us do good and why is there evil in the world?" The answer is simple: Allah (SWT) has created angels who do nothing BUT worship Him. The purpose of our creation is to choose to worship Allah (SWT) and do good deeds, but how can you choose to do good without first rejecting the opposite, evil? Without evil there would BE no good because "good" would just be the norm and if good was the norm, there would be no choice at all i.e. we would be angels.
I hope that this sort of helps if you were having difficulties understanding this concept. If anyone has any useful information about this subject please post it in the comments.