How do we know that everything works together for good? It is because those whom God foreknew He predestined to be conformed to the image of His Son. Now that raises a question or two! Pre-destination is one of those topics that causes enormous controversy and misunderstanding. It is probably fair to say that the response of most is to ignore it and hope it will go away. We will not do that here. Let's look at it first from a philosophical perspective, and then from a Biblical perspective. The philosophical part will be based on the Bible, so don't panic. In fact we will do the Biblical perspective first.
Our great fear with pre-destination is that we confuse it with fatalism. Ie we think that it means that because God has decided that something is going to happen then that means that all that we do is irrelevant. This causes many to reject pre-destination. Conversely, those who are ardent pre-destinationists fear that if what we do influences what happens then that somehow negates the sovereignty of God. Both of these fears are unfounded, and the extreme positions on pre-destination are unbiblical.
First we need to accept the limits of our human intellect, and use the Bible as both our guiding light, and as a boundary setter. Ie warning us when we are in danger of straying off in a wrong direction.
Now every book, probably every single chapter, in the Bible makes it clear that what we do matters. There are also numerous incidents where what God has done has been influenced by what men or women have done. He ejected Adam and Eve from Eden because of their sin. He relented in destroying Nineveh because they repented. In the gospels Jesus interacted with people, He responded to faith, or to lack of faith.
Now consider the passages where pre-destination crops up. Why does the writer (often Paul) raise the matter? It is definitely not to start an academic argument. Rather it is always done so as an encouragement to us, an encouragement for us to serve the Lord with more enthusiasm, dedication and confidence.
Now let's take a philosophical view. God is eternal, He exists outside of time, indeed He created time. So when God makes a decision in eternity how does that map onto our temporal world? Not in a nice neat manner! Look at God's promises and plans in the Bible. Two things are clear: (i) God's plans are always fulfilled in the end; (ii) they are rarely fulfilled in a straightforward manner! Was Abraham's or Moses' or David's life stories straightforward and simple? Definitely not. Has life been simple since the cross and resurrection? I don't think so.
God knows the beginning and the end, along with everything in between as well. So maybe decisions He makes are based on everything that happens.
So, do not ignore pre-destination, do not be confused by it, but be encouraged. Our lives take all sorts of twists and turns, but we can be sure that God's plans will be fulfilled. So we should be all the more dedicated to Christ, and live and serve with ever greater faith.