Nothing "bad" happens to a Christian without some spiritual cause! It's always for a good reason, to teach us something or because of our own sins, faults, mistakes, neglects or disobediences!
The Lord is in control! Nothing happens without His permission--or OUR permission! Sometimes we get OURSELVES into trouble through our own carelessness or prayerlessness!
The Lord does everything for a good reason. He says, "ALL things come of God", and "ALL things work together for good to them that love the Lord". (2Cor.5:18; Rom.8:28) He's trying to train, discipline and chasten us to make us better. But chastenings, like Paul confesses in Hebrews 12, are sometimes inclined to discourage us and tempt us to give up instead! But about that time the Lord always comes to our rescue!