Regarding God testing Abraham's faith by telling Abraham to offer his son Isaac as a burnt offering in Genesis 22:
I think there's dramatic irony in Gen 22. The events of the story turn out to be the opposite of what one would have expected at the climax of the narrative.
My understanding is human sacrifice to various gods occurred among many ancient Neareastern cultures. An ancient Neareasterner (like Abraham) might not unreasonably expect Yahweh to be like these other gods too.
Yet Gen 22 has a twist ending. The twist ending of the story is that Yahweh isn't like other gods.
Quite the contrary. Yahweh doesn't demand Abraham sacrifice Isaac. Rather Yahweh "provides" a ram caught in a thicket by its horns for Abraham to sacrifice. As such, Abraham learns Yahweh is the God who "provides", not a god who takes. Yahweh is the God who unilaterally blesses his followers, not a god who requires things in a quid pro quo fashion from his followers. Yahweh is the merciful God, not a god who must always exact his pound of flesh. Yahweh blessed Abraham because Abraham trusted Yahweh, not because Abraham literally killed and sacrificed his son Isaac in exchange for blessings like a pagan god might wish. These are the kinds of lessons Yahweh imparted to Abraham - and to us.
So this was a happy reversal of fortunes from Abraham and Isaac's perspective. They didn't have to do what they thought they had to do.
What's more, this happy reversal of fortunes in turn points to the One who reversed their fortunes - namely, Yahweh. Such that Abraham and Isaac, along with the audience, are led to ask: what kind of God is this, this Yahweh? Yahweh is not like heathen gods. Instead Yahweh is the God of promise, provision, blessing, grace.