These things happened to them as examples for us. They were written down to warn us who live at the end of the age.
Today's pressures make it easy to ignore or forget the lessons of the past. But Paul cautions us to remember the lessons the Israelites learned about God so we can avoid repeating their errors. The key to remembering is to study the Bible regularly so that these lessons remind us of how God wants us to live. We need not repeat their mistakes!