Complaints like this show the speaker's lack of trust in God's ways. As Moses sings:
"I will proclaim the name of the Lord.
Oh, praise the greatness of our God!
He is the Rock, his works are perfect,
And all his ways are just.
A faithful God who does no wrong,
Upright and just is he."
God is perfect and just. He does no wrong. He delivers just consequences for actions, just as he did for Moses. But His works are perfect. We can take heart because God is God, in any and all situation and have peace. We will never know and understand all of God's ways and his works, but we can know a good portion of it. As Moses said in Duet. 29:29, "The secret things belong to the Lord our God, but the things revealed belong to us and to our children forever." God's Word reveals to us our Father, our Savior and our Worker of Faith, the Holy Spirit. We don't need to ask why or to be anxious about what has happened or will happen. We know our God through His Word. And we know that God can do no wrong. So while we may not understand an individual event, we can take heart in knowing that God is perfect.
Putting this into practice is much harder, and frankly, impossible without the Holy Spirit. The Holy Spirit works faith within us and continues working that our faith may become perfect. This is a daily work until we are made perfect through Christ in our death to pass into life with Him. One verse that I turn to when I need the Spirit's help is Psalm 46:10 - "Be still and know that I am God." Knowing God's character brings peace. In the throws of a situation, it is hard to remember that. But that doesn't make it any less true.
Jesus says it best to his disciplines in John 16:33 - "I have told you these things [predicted his death and resurrection and the disciples grief], so that in me you may have peace. In this world you will have trouble. But take heart! I have overcome the world." Take heart! Our eternal salvation has be bought. The troubles of this world will come, but nothing can take away Jesus' sacrifice for us.