The first principle, one that should be a no-brainer, is to consider the context. Here's an example from my online friend. In Exodus 21 there is a passage that gives instructions regarding slavery. In verse 7 there are instructions regarding the selling of a daughter into slavery. That sounded to my friend like this God endorsed something like sex trafficking. Now, I have to admit that verse alone without the context to provide meaning sounds pretty bad to our 21st century ears. But that is a misunderstanding.
The passage on slavery begins with verse 1. In what follows God gives instructions that forbade holding a man as a slave beyond seven years, unless he chooses to remain as a servant. That establishes that the slavery in view here was more like indentured servitude. The instructions rather than endorsing slavery in any sense that we know it actually provide protection to indentured servants.
However, the instructions for a daughter who is sold into slavery is different. In this case, to prevent the very thing that my friend assumed, sex trafficking, the instructions are that she shall not be set free at the end of seven years. Why? Because a woman is to be considered more like a wife than a slave. As a wife, she could not be simply used and discarded. If there was something that displeased her husband/master, then rules similar to the rules of divorce came into play. She could be bought back by her father or close family, but she could not be sold to the highest bidder. The rules provided protection.
Still, it is described as slavery. That alone seems reprehensible. So that brings me to the second reading principle: consider the times and culture.
For people in 15th century B.C., slavery was sometimes the only way to avoid starving to death. There was no welfare. There was no government to take care of the poor. So for a man who had lost everything there was God's provision of selling yourself into slavery. It provided payment for a debt, and it provided a job, food, and a roof over your and your family's head. In seven years the debt was paid and you could go free. It was part of God's welfare system.
Compared to the conditions among other peoples, compared to some conditions today, the system God gave ancient Israel was humane, providing both protection and hope. It was the best rather than the worst of all possible worlds in 1400 B.C. That was true for a daughter who might be sold into slavery. She was protected from abuse. She was provided with a stable home and a status close to that of a wife.
The world today is, of course, different. Most governments do have some welfare system. There is no need for a man to sell himself into slavery or to sell his daughter just to survive. So this all seems cruel. Seen in context, however, it was not. It was the opposite of cruel; it was kind. It was good. And it was the very opposite of what my friend assumed. BTW he was able to see the sense in it when we discussed it. Give him credit.