Believing the Bible is the inerrant Word of God doesn't mean taking everything in it literally...
Every word of God is true, but not every word of God is meant to be taken literally. Sometimes God uses figurative language to convey Truth.
Some Islamic courts cut off the hands of people caught stealing (source). Christians don’t advocate such harsh punishments but we would if we took Matthew 5:30 literally.
Scripture contains hyperbole, personification, metaphors and other figurative language. If we insist that every word is literal, we'll need to join the flat earth society.(1)
Four Guidelines for Understanding Figurative Language in Scripture:
1. It's true and accurate in the figurative sense.
2. It's divinely inspired.
3. Some parables are similes or analogies, presented as such: "the kingdom of heaven is like ...." (Matthew 13:24).
4. Stories and narratives are historical fact. Jonah was
swallowed by a big fish and God parted the Red Sea.
It's not hard to discern figurative language in Scripture, but it's important that we do.
(1) A number of passages talk about the 4 corners of the earth (e.g.Rev. 7:1). If we took those passages literally, then we would have to claim that despite satellite photography the earth is flat. By the way, Christianity never promoted a flat earth - see Flat Earth Lie
To read more about the differences between figurative and literal language in Scripture, check out today's Bite Size Bible Study. Or check out these additional resources:
The Figurative Language of Scripture
How to Distinguish Literal from Figurative