God only gives good gifts, but that doesn't mean we'll find them pleasant at the time...
"Whatever is good and perfect comes down to us from God our Father.." James 1:17
People sometimes quote this and say it's proof that nothing unpleasant ever comes from the hand of God.
However, some things we consider unpleasant are actually good for us.
We grow through hardship in ways we cannot grow through pleasant circumstances.
We "suffer grief in all kinds of trials" so that our faith can prove genuine (1 Peter 1:6-7).
I have grown more through unpleasant circumstances than easy ones, and I know this is true for my Christian friends.
Sometimes God only allows bad things and uses them for our good (Romans 8:28).
But He also brings unpleasant things into our lives to produce great good in us (Hebrews 12:5-11).
"No discipline* seems pleasant at the time, but painful. Later on, however, it produces a harvest of righteousness and peace for those who have been trained by it." Hebrews 12:11
* God punishes us to turn us from our sins, but sometimes discipline is "training," not brought on by disobedience but by our Loving Father's desire to produce stronger faith in His children.
See God Punishes and Punishment, Consequences, and Condemnation