For many modern people the hardest part of the Bible is often the story of Abraham being told by God to sacrifice Isaac, obeying, then God stopping the procedure only when it was clear that Abraham really would kill Isaac in response to God's command.
This is a complex scene, which includes the element of prefiguring Christ's sacrifice; but I think one aspect that creates horror among modern people is that they assume God already knew what Abraham would do - therefore the scene becomes one of gratuitous psychological torture.
The notion that God is supposedly omniscient - in particular that God already knows everything that is going to happen in the future, is a piece of unnecessary Classical philosophy which has been unwisely built-into mainstream Christianity, and which deeply confuses people's understanding of the Bible.
Really, this is quite straightforward: God needs to test Abraham because God does not know whether or not Abraham will obey.
God does not know in advance the outcome of his test, for the very simply reason that Abraham is a free agent: he has free will, he really can and does choose what to do.
Therefore, the only way that God can know that Abraham is faithful is to observe him over time, and especially to observe Abraham's response to trials and tests.
This is one fundamental reason why our mortal life is necessarily - to some extent - a trial. (It is not, of course, the only reason for trails - because some and perhaps most trials come from evil forces, while others are consequences of the natural world).
How we respond to trials - and also how we respond to the temptations of luxury and pleasure - is something God needs to know in order to know us, and to measure our faith; and there is no short-cut to this knowledge: we must endure these trials.