The eighth plague was a huge swarm of locusts that decimated Egypt's extensive grain fields.
Moses said to Pharaoh, "for if you refuse to send forth My people, I will bring locusts."
The fact that G-d warned Pharaoh that he would be punished for not obeying Moses' demand means that the door to repentance was still open. True, G-d had made Pharaoh stubborn, but that just meant that it was difficult for him to repent. Had Pharaoh summoned the inner strength to listen to his conscience, he still could have let the Jews go and spared himself and his country the impending ruin.
The lessons for us are as follows: First, no matter how estranged we may feel from G-d, even if it seems as though G-d has shut the door on us, nothing can resist our sincere efforts to return to Him. The apparent estrangement exists only in order to inspire us to summon a deeper, more powerful resolve.
Second, no matter how far another person may seem to have strayed from G-d, we must never despair of him. With true love and friendship, we can encourage him to mend his ways, and with G-d's help he will come back to his true, inner self.
From Daily Wisdom