God told Moses to tell Pharoah to set his people free. Moses did what God asked but Pharoah refused. Then God sent the plagues to try to help Pharoah understand who really was God and therefore to let his people go. Plague after plague the scripture says that God hardened Pharoah's heart to no avail. Many folks are troubled that God would harden Pharoah's heart. Why would a God of love do that?
So what was going on? We in our day and time can't see beyond the obvious. What was happening was a competition to demonstrate who really was God. But even understanding that we are missing a couple of things that people in that day and time would have understood.
The first key is a better translation of the Hebrew word that was originally translated as hardened. That translation is heavy. So God made Pharoah's heart heavy.
The second key is an understanding of the Egyptian process of how to get to the afterlife. (Having lived in Egypt for hundreds of years, the Hebrews knew all the Egyptian customs.) The Egyptians believed it was a two step process. The first step was a "justice examination". The Egyptian god of Justice was symbolized by a feather. The examination required putting your heart on the justice scale opposite of the feather of justice. If you had lived a good and just life, your heart would be lighter than a feather and you would go to the next step of getting to the afterlife.
So, God's actions were making Pharoah's heart more and more heavy as he was unjustly holding the Hebrews in Egypt. And because of that Pharoah was not going to make it to the afterlife. Therefore, God wins!
So it was not about making Pharoah's heart hard, it was getting heavier. And all to prove who really was God. Hopefully that helps!
Have a blessed day!