In Genesis 4:1-7 is the story of Cain and Abel’s offering. God accepted Abel’s offering and rejected Cain’s offering. The interesting thing about this is that God never explained to Cain why his offering was rejected, He just gave him instructions and a warning about the future. Our natural inclination is to do everything to try to explain why God judged Cain’s offering as unacceptable. The fact is that God often does not explain Himself, and cannot always figure out the judgements of God. Of course, I believe if Cain had asked God what he needed to do to have his offering accepted, God would have answered him. Just like God answered the Israelites when they sought Him to find out why they lost at Ai. God always has good reasons for what He does. His judgements are just because He sees the heart, and He sees things we cannot see or understand. Frankly, it is not our place to fully grasp why God does everything He does. We are not supposed to figure Him out, we are supposed to come to know Him. The most important thing for us to focus on is finding out what God desires and seeking Him to find out what pleases Him and then doing that. But it is deeper than even that. It is seeking Him to develop a deeper relationship with Him and eliminating things from our lives that hinder that.
So if God is not explaining Himself to you, stop trying to figure out why He does things. He is God, and only He has the ability to run the universe because it is too complex for us to understand. If we could figure out how to make the right decision in every situation, we would be God. There is a reason He is God and we are humans. Let Him do what only He can do without questioning His character. You will get much further if you seek to know and love Him instead.