All that happens in the life of born again believers in the Lord Jesus Christ is either determined or allowed by God, and all is coordinated and fit together according to His perfect foreknowledge.
"God... worketh all things after the counsel of His own will" (Ephesians 1:3; 11).
"All things work together for good to them that love God, to them who are the called according to His purpose" (Romans 8:28).
By the time life happens to us, God has already happened to it. That is, He directly orders and orchestrates the good, righteous and holy things of His perfect will. Or, in His infinite wisdom, our Heavenly Father knows how to adjust and apply all other things for our ultimate benefit and the fulfillment of His eternal purpose in Christ Jesus. I would not suggest trying to figure out how He possibly does this. Perfect foreknowledge and infinite wisdom - for which we have no frame of reference - are required for this blessed working in our lives. It is enough that we know and believe such Truth to be true, and that we often affirm it in our hearts and among each other.
Few teachings of Scripture more assure our hearts, particularly in times of trouble, pain and difficulty. We live anticipated lives, as it were. The One to whom we have entrusted both time and eternity knows all that will ever come our way. Before ever we were born and born again, He planned a course of action that will fit all things together for the purpose of conforming us to the image of the Lord Jesus (Romans 8:29). Nothing catches our Lord by surprise, and nothing can hinder His determination and promise: "He which hath begun a good work in you will perform it until the day of Jesus Christ" (Philippians 1:6).
Much will happen in our lives that will furrow our brow, accelerate our heart rate, bewilder our minds, and foment questions of unrest and concern. We confront such temptations by gazing into Heaven and seeing no furrowed brow, no accelerated heart rate, no bewildered mind, and no questions whatsoever. Indeed, as long as God is untroubled, we are safe. As long as His Word is true, we are safe. As long as He will "work all things together for good," we are safe. And as long as nothing comes to us apart from His determination or allowance, we are safe. This is peace, and there is no other.
"His understanding is infinite."