Everything that was written in the past was written to teach us. Those things were written so that we could have hope. That hope comes from the patience and strength that the Scriptures give us.
The things that happened to those people are examples. And those things were written to be warnings for us. We live in the time that all those past histories were pointing to.