Many people love God and thank Him when everything is going smooth and absolutely wonderful for them; and many people don't. However, when things get a little bumpy or things are more than overwhelming, they forget all about God; or they ask why God.
The Word says, "Is anyone among you in TROUBLE? Let them PRAY. Is anyone HAPPY? Let them SING SONGS OF PRAISE." James 5:13
That's the beauty of God and His Word, it gives you clear direction and instructions. It tells you what to do and how to do it in every situation and circumstance in your everyday life. Then why doesn't things happen according to plan. First, when we live a life outside of God's direction and instruction, how can we expect for things to go great without troubles. Secondly, we live in a broken and sinful world; which means regardless of who it is and what it is, there will be trials and tribulations. Some greater than others and some that really won't seem as if its a problem at all. The importance is that God is the key.
God the Father takes care and provides for us in every aspect of our lives just as a parent/guardian should do. Besides, He is our creator, how could He not and why would He not. His Word alone gives us so many promises and gives us life. He gave a us a friend and a savior and a Lord that helps us, redeems us, and saves us, Jesus Christ. Jesus is the only way to the Father, He is our escape, and He is the truth the way and the life. God also provides comfort, gives directions, and leads with instructions through Holy Spirit. Holy Spirit is that gut feeling, that voice you hear, and your conscious and subconscious on thoughts and actions in your life when making decisions.
So what does that have to do with frankly anything with the Scripture above etc, well within that scripture; when you listen to it, put it in your heart, and take action by applying it; you will start seeing that what I said is truth.
Therefore, don't just praise him when things are good nor ask why God when things are bad. Pray to Him and talk with Him always. Listen to Him and get to know Him. I promise that when you acknowledge God in every area in your life and you follow the plans He has for you, This scripture will be more than encourage and words, it will become a lifestyle.