There are those who believe that what happens to us in this life are the result of our good or bad behavior. There are indeed consequences to both, but not all that happens to us ( especially those who are Christians ) is because of our sin or our good deeds. There are things that are justly the will of God and a part of His plan for a purpose.
Look at Zacharias and Elisabeth. It says they were both righteous in the sight of God. They followed the law to a tee. Yet, they had no child. Something that was greatly desired of Elisabeth and cherished among women. Year after year had passed until they became past the age of bearing. It was not as punishment for a misdeed, a horrific hidden sin. They walked perfect before the Lord, remember? No, it was simply part of God's blueprint for their lives. Every person, every event, had been timed down to the minute when and how it was all supposed to finally come together.
God still works that way today. We may have unexplainable happenings in our lives - a sudden death, foreclosure, the loss of a good job, a project that keeps dragging out longer and longer. Don't worry. Stay in prayer, stay firm in the faith. God doesn't have to answer to us. He doesn't have to give us a play-by-play. His only request is that we simply trust in what He is doing. Part of his job is giving beauty for ashes; taking the broken, confusing pieces and making sense of it all.