To every thing there is a season, and a time to every purpose under the Heaven. Ecclesiastes 3:1
The LORD has made everything for its purpose, even the wicked for the day of trouble. Proverbs 16:4

That which hath been is now; and that which is to be hath already been; and God requireth that which is past. Ecclesiastes 3:15
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. Jeremiah 29:11
https://stillfaith.com/topics/everything-happens-for-a-reason/
Athletes and other achievers are able to accomplish much because of discipline. They’ve purposefully trained their bodies and minds, often to their own discomfort, in order to achieve results. The same is true of our spiritual lives. Hardships and trials are tools that God uses to discipline us, to provide spiritual training so that we may produce greater fruits of righteousness.
And we pray:
Lord, I confess that it is my nature to seek easy paths and comfort. When hardship comes, I look for a quick solution. Help me to endure trials, Lord, for Your sake. Help me to lean on Your Love and Your desire that I would grow into maturity. Give me the wisdom to learn from times of hardship so that I may be more prepared to live for You. In Jesus’ name, Amen.