Many operations are actually called off at the last second (literally second) because a civilian risk is discovered.
Unfortunately, we’ve had wounded soldiers bring back some pretty horrific stories about what they had to deal with.
One instance was a man attacked them holding an infant in one hand while firing a rifle in the other hand.
Others have seen Hamas insurgents dressed as women.
Also, attacks from schools and hospitals are commonplace.
To answer your question, yes Israel tries to avoid civilian casualties but usually these decisions must be made within seconds and sometimes mistakes are made. In other instances, there’s no “good” choice.
Thank you for your question.