When someone, for instance, wants to buy something from the store and decides to send his first son to buy him that thing because he knows in advance that this boy is wise and will go straight to buy him what he wants exactly. The father also knows that his other son will get distracted by playing with his peers and lose the money. Actually, this is only an assumption upon which the father built his judgment.
Being aware of the destinies does not contradict our free will because Allah is aware of our deeds based on His complete knowledge of our intentions and choices, bearing in mind that Allah has the highest attributes, and He knows the nature of mankind. Allah is the One Who created us and knows what lies in our hearts, the good or evil desires, and knows our intentions and deeds. Writing down such knowledge does not contradict our free will, knowing that Allah's knowledge is absolute while people's expectations could be right or wrong.
It is possible for man to act in a way that displeases Allah; however, his act will not contradict Allah's will. Allah has granted His servants the will to choose, yet even if their acts are sinful, they still remain within the boundaries of Allah's will and can never go against it because the Almighty Lord has not given anyone the ability to transcend His will.
We cannot force our hearts to accept something that we do not want. We can force someone to stay with us under threat; however, we can never force that person to love us. Allah has protected our hearts from all forms of compulsion, and this is why He holds us accountable and rewards us based on our intentions and what our hearts bear.