Elijah, John the Baptist, and Jesus
The prophecy here has a double fulfillment because there were two types of restorations that were going to take place. The first is a restoration of hearts being open to God, so that what men would do for God (their offerings) would be acceptable to Him. John the Baptist came as a type of Elijah, according to Jesus in Matthew 11, for those that would accept it. The second would be a completion of God's promises to the Jews as a people and as a nation. And again Elijah, or one like him, would come to help prepare the way of the Lord who was coming both to restore and to eliminate all opposition to Himself.
John the Baptist was a cousin of Jesus and no doubt they knew each other. John's father was one of the Levitical priests and was able to have a chance to serve at the main temple and be the one man for that year to enter into the sacred Holy of Holies. The nation would have been aware about the story of the angel appearing to him there announcing the pregnancy of Elizabeth with John, and indeed the common people believed that John was a prophet in their midst, the first since Malachi. The people, recognizing that John was a prophet, and hungry for God, sought him out in the wilderness to find what God's desire was for them. And John told them that God wanted repentance from all desires and actions that were apart from the law of God. When the people went into the water to be baptized they were publicly declaring their sinfulness and desire for a clean heart. John prophesied to them; "I baptize you with the water of repentance, but He who is coming after me is mightier than I . . . He will baptize you with the Holy Spirit and fire." (John 3:11)
The Pharisees, Sadducees and other religious leaders could not understand the ministry of John because his was a move of the Spirit outside of the Jewish rituals and laws, things they could obey without really having to surrender their hearts to God. And so they didn't recognize the times or the significance of what John was doing. One day Jesus, who was the fulfillment of everything that the laws and rituals represented, came to John to be baptized by him. This was just before the beginning of Jesus ministry. John understood that the purpose of his ministry was to prepare the nation for the coming of Messiah. He knew Jesus and must have talked with Him at times about the fulfillment of scripture. He knew the life and character of Jesus and the Holy Spirit would have witnessed to him that Jesus was, like him, a prophet sent from God. But John does not want to baptize Jesus, saying; "I have need to be baptized by You", and Jesus responds; "Permit it at this time, for in this way it is fitting for us to fulfill all righteousness".
Jesus was the second Adam, representing mankind in those waters. He was the legitimate and prophesied heir to the throne of David, representing the Jewish nation. And although He was truly God, He was also flesh and blood. His ministry began by being obedient to the Father, and when rising from the waters the Spirit of God descends upon Him, and a voice from the heavens declares; "This is My beloved Son, in whom I am wll pleased." The baptism by John was a prelude to a new life that was coming in the Son, brought by and outflowing with the Spirit of God.