It was written so that we could have life and life to the full. An example of this is when someone is born outside of wedlock. That means that the parents did the conception outside of a holy covenant known as a marriage. The child is born and looks just like its father and mother.
But the parents have a choice: to instruct their child while the it is still in the mother by listening to the word of God, or to do what they want while still pregnant with the baby.
I want this to be an example of the bible because I want to tell you that the book has been provided for us so that we can live in the way God wants us to live. It was written as God's love letter to you and me. We should appreciate it and follow its teachings.
Another example of the bible being written for our good, is what is happening in today's world and society. God has hamstrung together his word to bring his people close to his heart.
As I said before, we are not in the last days just because the countries like Jerusalem, Israel and Judah are having issues and politics are in an uproar because of our nations's new president. Just because in Revelation it talks about the last days, it already came to pass, doesn't mean for sure that we are entering into the final tribulation. Jesus is not coming back for a long time.
Back to the example I gave in the beginning.
I gave the example not to criticize you parents of children who have had sexual relations outside of marriage. I gave that example to help you understand that the bible has been provided for you and your son/daughter to read later in life.
Hope this gives you encouragement and lifts your Spirit!