If Hashem knows everything thats going to happen, isnt that a
contradiction to bechira?
This question was asked a thousand times here. The Rambam in his Hilchos Teshuva (5-5) explains the following: כי לא מחשבותי מחשבותיכם. I know things, not the way you know things. “Don’t use your understanding of how the world runs and try to apply it to how I see things,” says Hashem. You know things through cause and effect.
Therefore, if you know something is going to happen, you know it because of certain laws of nature, certain laws of cause and effect. But Hashem knows things differently than that. He’s not limited to the laws of nature that He created for you in this world. He an look ahead into the future because He is above time. Hashem is way above your houghts. He can see the future not because it has to happen but because He knows what’s going to happen. Free will is not a contradiction to Hashem’s knowledge at all.
How does He know? The answer is כי לא מחשבותי מחשבותיכם. I know things in different ways than you know things. Don’t try to understand My ways through your thoughts, through your ways of thinking. And therefore, Hashem’s ways of knowing things is not for us to explain. כי גבהו שמים מארץ כן גבהו דרכי מדרכיכם ומחשבותי ממחשבותיכם. It’s not a contradiction at all.