The Apostle Paul was put in prison because he dared preach Jesus crucified and resurrected.
Even in prison God used him for His purpose. He had a lot of time on his hands, and he used that time to write many of his Epistles in the Bible.
Proverbs 3:5-6 Trust in the Lord with all thine heart; and lean not unto thine own understanding. In all thy ways acknowledge him, and he shall direct thy paths.
If you are trusting in the Lord with all your heart, God has you where you are because that’s where you will bring Him the most glory. It’s there that He prepares you for assignments down the road. It‘s there that you will grow, be developed, and shaped for His service.
The best thing you can ever do is learn to “grow where you are planted” and become all God saved you to be.