Jeremiah 29:11
For I know the thoughts that I think toward you, saith the LORD, thoughts of peace, and not of evil, to give you an expected end.
God has a plan and a purpose for our lives. It may not always look like what we think it should be or what we desire it to be, but that doesn't mean there isn't purpose.
God dos not desire bad things for us, but we may see something as bad even thought it is for our good. For example, when in college, I was engaged to my high-school sweet heart. That came to a crashing end when he confessed he was cheating on me and had before. I thought my world had come to a crashing end. However, as I grew and matured in my relationship with Christ, I saw that it was for my good.
It was through that experience that I realized I had nothing to offer God. I realized I truly needed Him and a relationship with Him. It is what drove me to my knees and caused me to be at the end of myself and give myself fully to Christ. It also opened up avenues for me to meet and get to know my husband.
I definitely didn't like going through the pain, and even after I gave my life to Christ, I would question His goodness in the situation, but that didn't change the fact that it was good.
Difficult times can cause us to pull away from God or run closer to Him. I suggest running to Him. Seek His peace, His strength, His love. He desires to give us an expected end!