When reading about the Lord's chastening in Hebrews 12, it is important to understand that the book of Hebrews was written in Greek, and "chastening" is the Greek word paideu, which means "to train children, to cause one to learn, or to be instructed or taught". Hence, the Lord's chastening is to be seen in the context of our heavenly Father teaching or disciplining His children.
Now, we know we have a good heavenly Father who loves us very much (John 3:16). Jesus Himself shows how good our heavenly Father is when He asked in Matthew 7:11, "If you then, being evil, know how to give good gifts to your children, how much more will your Father who is in heaven give good things to those who ask Him!" So, if earthly fathers do not teach or discipline their children with sickness, disease and poverty, then all the more, our heavenly Father will never teach us by punishing us with bad things.
So how does God chasten, or train, His children? Hebrews 12:9–10 (KJV) explains, "Furthermore we have had fathers of our flesh which corrected us, and we gave them reverence: shall we not much rather be in subjection unto the Father of spirits, and live? For they verily for a few days chastened us after their own pleasure; but He for our profit, that we might be partakers of His holiness."
These two verses make a comparison between "fathers of our flesh", or our earthly fathers, and "Father of spirits", our heavenly Father. "Fathers of our flesh" discipline our flesh, while "Father of spirits" disciplines us in our spirits, through His word. This means that as you read the Bible, or as you listen to God's Word being preached, you are being trained, being taught by the Lord.
The writer of Hebrews goes on to say that when God disciplines us, we know that we are sons, not illegitimate, that we are loved, and that we will live and profit (Hebrews 12:8–10). Chastening of the Lord, then, does not refer to God causing accidents or illness to happen to us, for if God disciplines you with death, sickness and disease, how will you "live" and where is the "profit"?