God Is Bigger
Am I in the place of God? You intended to harm me, but God intended it for good to accomplish what is now being done, the saving of many lives.
Romans 8:28 says: And we know that in all things God works for the good of those who love Him, who have been called according to His purpose.
As Joseph looked to God and trusted Him he was able to see His plans and purpose for His life. Perhaps because Joseph saw that God even used his brother's evil schemes and that his suffering had a greater purpose, he was able to forgive and love them just as Yahshua was able to forgive those at His death because like Joseph's brothers they didn't know what they were really doing.
Pray that God might reveal His perspective of your current trials and in the mean time trust that your loving Father can work all things for good for those who love Him.