It is good that we know the history of the people of Israel, because in it are hidden so many stories that we as Christians must know for our joy, not to make the same mistakes and to understand all the good and portentous works that God did in them, which God has also done in us by bringing us to His glorious ways.
The prophet Isaiah says:
4 In that day you will say:
“Give praise to the Lord, proclaim his name;
make known among the nations what he has done,
and proclaim that his name is exalted.
5 Sing to the Lord, for he has done glorious things;
let this be known to all the world.
6 Shout aloud and sing for joy, people of Zion,
for great is the Holy One of Israel among you.”
Recall that the people of Israel passed great tests, which were often caused by their own disobedience, we see them captive in Babylon, walking 40 years in the desert, being often defeated by other nations, bringing famine to the nation, among many other afflictions.
In spite of all the disobedience in which they were trapped, God never stopped warning them and wanting to bring us back to Him again. In the same way is our God with us, if He sees that we turn aside, then He does not leave us on the ground, He looks for the way to draw us to Him.
The Bible says that He does not want any to be lost but that we all proceed to the continual repentance that is in Christ Jesus our Lord.
These verses are a way to motivate the people of Israel and to make them understand that one day salvation would come for them and they would rejoice in His Holy Name.
In the same way we, although we are going through the most cruel tempest, we must rejoice in our Creator and know that one day our tears will become perfect joy. We believe in God with all our heart!