Use it to be better
The word discipline is used quite a bit in this passage. Our first thought often is that discipline is equal to punishment. However, here the writer is using it in a way that would be similar to that like an athlete. One who uses every chance to get better be it training, off time or game time. The point being that we can learn about God in hard times as well as good. So what do we learn?