Oh how many times I have heard that said to someone in trouble and oh how many times I have said a variation on that phrase.
But I know someone who doesn't like the plan for her life. She is just waiting for everything to be OK, and it's not. It has been years, her whole life, and nothing is as she wants. So what do you say to that?
Joseph experienced a lot of years like that. Through his teen years everything was great but then he was sold into slavery by his brothers and everything went downhill --- for 20+ years!
It says in Genesis that "God was with Joseph." Joseph couldn't see that. He couldn't feel it. He couldn't see God working. But God was there with his child. Just because life isn't going the way you want doesn't mean God is against you or has left you.
When Joseph was in Potiphar's house, Potiphar's wife wanted to sleep with Joseph. He could have figured that God had left him and not worried about sinning at that point. However, Joseph stayed true even though it didn't feel good. Potiphar's wife actually clawed the clothes off of him, but he shoved her off and literally ran away. That's what we are to do --- flee youthful passions, run from sexual immorality, get away from temptation. Literally move away from temptation. This isn't a figurative instruction to run/resist; we are to actually get up and get out of the tempting situation. Otherwise, we will talk ourselves right into what we don't want to do.
I love this example --- we don't put a fish on a hook. We tempt the fish to put itself on the hook. If it ran from the worm, it wouldn't get caught. However, the longer it floats and stares at the worm, it talks itself into taking a bite.
But even if we do the right thing, that doesn't guarantee everything will work out perfectly in that moment --- in that moment. Joseph was thrown into prison after running from Potiphar's wife. But that was a bad situation on the way to much better things later in his life. God did not leave him.
So the sentiment of "God has a plan for your life and everything will be OK" is partially true. God does have a plan for our lives, and often God does step in and make everything OK, but not always. Sometimes life is icky and we just have to honor God through it. Then in heaven we will receive our reward, and that eternity in heaven is so much better than the short time on Earth. So use this time of trial to build up the best rewards possible for you in heaven.