"And Joseph's master took him, and put him into the prison, a place where the king's prisoners were bound: and he was there in the prison." Genesis 39:20
What do you do when you are living for the Lord, keeping His commandments, serving Him, and things still "go wrong"? This was the case with Joseph-- not once but several times. He was serving his father. Doing all he commanded. He was living for the Lord. God was revealing things to him through dreams. He did all the right things, but what did it get him? Slavery and prison. (Not a good outcome, in my opinion.)
So again, what do you do when you are living for the Lord, keeping His commandments, serving Him, and things still "go wrong"? You have a choice. You can either let it make you "bitter" or "better". I am sure there were times when Joseph got angry, frustrated, confused and felt helpless over his situation. I am sure he questioned the Lord about his situation-- after all, he was still human. I am sure he wondered if things would ever change. But he did not let it make him bitter, revengeful or hateful. He didn't get angry with God and stop serving Him. Though he probably questioned, his faith, love and trust in God stayed intact.
Don't let your circumstances make you bitter. Look at the life of Joseph one more time. All that happened to him-- though it looked bad-- was actually working together for his good. It was setting him up for his destiny. It was making him into the person God needed him to be for the plan He had. This might be your case as well when things don't go according to plan or they go in the opposite direction than you thought they would.
Have a great day. Don't let your situation make you bitter. Let it make you better.