Evil and pain is not caused by God, it is the consequences of sin that caused pain and evil, whether it was your own sin or someone else’s sin.
Examples:
Consequences of your own sin:
A child is fascinated by a Candle flame, he keeps getting very close to it and touches it and get burned, he runs to his father seeking comfort and healing. His father holds him but also admonishes him for touching the flame, and commands him not to do it again. After a while the child does it again! And then he runs to his father seeking to relieve the pain, his father does the same thing. The father loves his child and he’s deeply moved by his child’s pain. And he’s willing to hold his son and to try to comfort him as many times it takes.
Now thats how our heavenly Father loves us, he would never wants us to get hurt. But we do get hurt whether physically or emotionally in this world because it’s the consequences of sin.
As for the consequences of other people’s sins.
A man is smoking inside a building, he is very used to it although he knows better than to smoke indoors. One night at a very late hour he is lying on the sofa watching TV and smoking, he eventually fell asleep with the cigarette in his hand, which fell on the floor and started a fire. Now the apartment could’ve burned causing not only his own death but the death of others in the building. Or it could’ve only killed him but the firemen got in time to evacuate the rest of the building.
In both scenarios the guy’s sin caused other people harm whether their death or inhaling smoke and the trauma it must have caused them!
You see God does not cause any of bad things that happen in our lives. It is only the consequences of sin.
As for how God tests us, is how we react in these tough situations and trials. Are we going to turn around and blame him for everything or are we gonna go to him with great love and reverence and thank him for all the graces he has given us in our life?
I’ll give you another example.
A child is climbing a tree, his mother waits at the foot of the tree calling him to come down before he hurts himself. But he keeps climbing and his foot slips and he falls off of the tree, and he hurts himself, he starts to yell at his mom, telling her that it was because of her constant call for him he got distracted and fell. But the truth is as we know he fell because he wouldn’t listen to her.
So are we gonna blame God for every time we fall and get hurt, or are we gonna thank him for watching over us and taking care of us after every time we fall, and for staying with us even while we continue to sin and offend him?
As for God’s test to Abraham, which was totally deferent from the consequences of sin. God wanted to know how much Abraham trusted him, and Abraham trusted God to the point of obeying God when he commanded him to sacrifice his only son. Of course this shows that Abraham didn’t live for himself, he lived for God, he did exactly what Jesus said in Matthew 16:24, he denied his own will which is not sacrificing his only son and followed God’s will to sacrificing his son. Of course after God saw how much faith and trust Abraham had in him, he exalted him and made him the father of Israelites, It was just a test. God would’ve never really allowed for Isaac to be sacrificed.
Like every father or parent who is teaching his kid how to ride a bike. Of course the kid doesn’t want his father to let him go, for fear of falling and getting hurt. But the father knows best, he asks his kid to just trust him and to give up his own fear and will (which is to not allow his father to let go of him) cuz the father knows best.
So God wants from us what he wanted from Abraham, and that is to trust him with every single detail in our lives. And he tested Abraham on how much he trusted him. After that God gave Abraham not only his son back but also descendants as numerous as the stars.
God will not harm you to tests you. God will ask you to walk on water, get out of your comfort zone, and trust that he knows what’s best for you, and that he knows you more than you know yourself. Why do you think Jesus chose Judas as a disciple? Even though he saw the evil Judas can do he also saw the good he can do, and wanted him to deny himself and follow him. So Judas had a choice but he made the wrong one. Like the other 11 disciples, they had a choice, but they made the right one.
Peace