Exactly. Trials are necessary for our maturity in Christ. I love what James 1:2-4 says:
Consider it pure joy, my brothers and sisters, whenever you face trials of many kinds, because you know that the testing of your faith produces perseverance. Let perseverance finish its work so that you may be mature and complete, not lacking anything.