We can learn so much from Pharaoh. He wasn’t Jewish, he hated the Jews, inflicted us with 80 intense years of suffering plus the years that were less intense, yet HaShem gave him SO many opportunities to do Teshuva before he was killed. HaShem gave Pharaoh opportunities to let us go. It’s said that the plagues lasted a month long- 1 week was the actual affliction and 3 weeks break until the next one. He could’ve let us go, but he didn’t.
Now, if HaShem gave Pharaoh the opportunity for Teshuva, how much more so does he give us the opportunity and want us to do Teshuva. He loves us so much and wants what’s best for us. But now it makes sense to be curious as to why would HaShem inflict pain on us if he loves is.
At the very end of the Parsha after the plague of ברד (hail,) Pharaoh says to Moshe and Aharon, "I have sinned this time, HaShem is righteous and I and my people are wicked." Seems to be that Pharaoh finally learnt his lesson? As we all know, that wasn’t the case. But why not? He admitted to his guilt. He knew he was wrong!
Though, this is all when he was under pressure. As soon as the plague and pressure left, he returned to his old ways. He viewed suffering as a punishment for his wrongdoing. That was his mistake. Sometimes we don't see HaShem in our every day-to-day lives. When we fail to see and thank HaShem for everything, He has to give us a little bit of a wakeup call and push. Pharaohs mistake was not realizing that he had to change something about himself, and not just say I'm sorry, but continue with what he was doing.
When we start to view suffering as a way to elevate ourselves, we will find meaning in our suffering. It helps us not only cope with the pain of the suffering, but helps us open our eyes to ask ourselves, "how can I use this suffering/message to improve myself?” Hashem doesn't punish us. He wants what's best for us. We just have to open our eyes to see it.