Joseph's brothers meant what they did to him for harm, but God meant it for good(Genesis 50:20). Perhaps your afflictions are for good also. Just keep trusting God(Isaiah 55:8_9) and He will never put you to shame.