Probably of all the stories in the Bible, one of my favorites is the story of Joesph. Joesph was one of Jacob's 12 sons. Jacob was the first born of Rachel. Rachel was the wife that Jacob had wanted to marry, but he had been tricked by his father-in-law into marrying her older sister. Jacob loved Joesph and his brothers could tell that he favored him. His brothers were jealous that their younger brother was favored by their dad. If you remember the story, one day Joesph is sent into the field to meet his brothers. His brothers are filled with envy and attack him and throw him into a pit. When a group of traders go by in route to Egypt, they sell them to him. When they return to their father, they lie to him and tell their father that Joesph is dead.
Now Joesph is sold into slavery in Egypt. He ends up in prison. He interprets the Pharoah's dream and then become one of the most powerful men in Egypt. When a famine hits the land, his father sends his brothers to Egypt, because Joesph has overseen a massive campaign to preserve food through years of plenty. Egypt is now the only place in the land that has any food, because the famine has been so severe. Joesph plays with his brothers a little, before he reveals himself to them. His brothers are terrified. There brother is now a very powerful man, and they are afraid that he will try to get even with them. Joesph tells them don't worry about it. You did something for evil, but God has used it for good. The Israelites relocate from Canaan and settle in the land of Goshen. It is there that God provides for them and builds them into a great nation. It is that time in Egypt that builds them up and prepares them for the conquest of the Promised Land.
Have you ever just screwed stuff up completely? I know I have more than I like to admit. God has that all under control. Even when Joesph's brother were acting in an awful way, God was using there wrong to set in motion a plan to save his chosen people. If Joesph had not been sent into Egypt, then it is unlikely that they would have survived the famine that was to come. It is amazing to me that God can even use the wrong that we do to acheive his will. His brother's were wrong to sell their brother, but God used that to place Joseph in the right place at the perfect time, in order to preserve his people, and to build them into a mighty nation. I need to keep in mind that when I fall down, and completely mess this thing up, that God has it all under control. He may even use the wrong that I do to bring about something that will be amazing to me. God uses us in our weakness to bring about his will. He never expects us to get it all right. He does want us to trust him, and to seek his heart. If Joesph had not trusted God and sought to do right, then he would never have been sent to prison. If he had never been sent to prison then he would have never been able to interpret the Pharoah's dream. The story would have had a completely different ending. Trust God. Even when you fail, he is still working.