In the story of Cain and Abel, God punished Cain for murdering his brother but still took care of him so he wouldn’t suffer the same fate. A good parent corrects (not abuses) their child. We LOVE God when HE blesses us, but get upset with Him when He allows us to suffer the consequences of our own actions. Here we can apply the word in Proverbs 13:24 “…Those who love their children care enough to discipline them” and I do believe God truly loves us.
For though he wounds, he also bandages. He strikes, but his hands also heal. (Job 5:18 NLT)