In James 1, we're told, "Let no man say when he is tempted, I am tempted God: for God cannot be tempted with evil, neither tempteth he any man: but every man is tempted when he is drawn away of his own lust, and enticed."
And in 1 Cor 10, "There hath no temptation taken you, but such as is common to man: but God is faithful, who will not suffer you to be tempted above that which you are able; but will with the temptation also make a way to escape, that you may be able to bear it."
This is how I know that every act or thought is preordained of the Lord. So how does the Lord know the end from the beginning: Because time itself is/has been created and he dwells outside of time, observing the entire time line in the same instant. So that not only are a thousand years as a day and a day is as a thousand years, but also: 10,000 years are as a day and a day is as 10,000 years too. ect... ect...