While perhaps not being able to explain precisely how this is possible (since, in fact, there may not be any means through which God knows the future; he may just know it intuitively), one can nevertheless show that the argument meant to demonstrate that it is not possible fails. The argument asserts that if God knows I will do X, then it is true that I will do X. If it is true that I will do X, it is not possible that I do other than X. But if that’s true, then I am not free with respect to X.
There are many problems with this argument, though space permits discussion of just one.
The assumption that freedom requires the possibility to do otherwise is false; in order to illustrate this, consider the case of a man who wakes up only to be greeted by a long lost friend. Delighted, the two partake for hours in long and satisfying conversation. If the man comes to find out later that the door to his room was locked for that entire stretch of time such that it was not actually possible for him to leave the room, must we conclude that he did not remain in the room freely? It seems not.
What this appears to show is that what is crucial as far as freedom is concerned is the absence of causal constraint with respect to our choices, rather than the presence of alternative possibilities.