"And we know that for those who love God all things work together for good, for those who are called according to his purpose" (Romans 8:28, ESV).
Romans 8:28 seems to present a paradox. It is understandable how good works for good but difficult to see how bad works for good. However, when we consider the conditional parts of this verse that say "for those who love God" and "for those who are called according to his purpose" we are no longer perplexed. Love and commitment to God and His purpose produce conditions for God to work all things, both good and bad, towards His good purpose. His good purpose is our restoration. Consider this: "Before I was afflicted I went astray, but now I keep your word" (Psalms 119:67, ESV). "It is good for me that I was afflicted, that I might learn your statutes" (Psalms 119:71, ESV).
Our human nature drives us to choose self over God, and we reap our own demise when we don't change our choice. But there is hope. God wants to restore us to Him, and He will use all of our life circumstances to do so if we allow Him. But we must be teachable. Jesus said unless we humble ourselves and reach out to Him as dependent children we cannot enter His kingdom—we cannot receive life through His Spirit. (See Matthew 18:3-4 and Luke 18:16-17.)
It's simple! Jesus changes everything when we change our choices. If we love Him and commit to His purpose He will work all things for our good. If we reach out to Him like a dependent child and become teachable He will give us life. Through His Spirit He will restore the life we lost when we choose Him.