God's purpose is love. Those called according to His purpose are those people who desire to follow after love. God's promise is that no matter what happens in your life, if you are following after love, He will make it all work together for good. Because God knew who would receive His life into their hearts, He prepared a plan for those people. This plan would makes everything that happens to them work together to conform them to the image of His own Son.
Not a thing can befall us that He cannot use to call us into a deeper walk with Him. Loneliness certainly is not good. Personal tragedies and heartaches certainly are not good. But although we experience the tears and a longing to be free of these things, we can know with a sure confidence in God's character of love that He is working every single thing together for good and that every single experience is contributing to our capacity for God.
God envelops His plan in grace. He has already justified us; He sees us just as if we never sinned. He has glorified us in the Finished Work vision of His mind's eye. Because of love, God didn't even spare His own Son to deliver us out of death. How much more, with the Son now abiding within us, will He now work all things together to provide us with His life?
If God be for us, who can be against us? It is never too late for God to turn the mistake or the tragedy into something good. Because of the love of God, the best days of our lives are ahead.