John chapter 3 is a key section but you only quoted a little bit of John the Baptist in the last verse:
"I am not the Christ, but that I am sent before him. He that hath the
bride is the bridegroom: but the friend of the bridegroom, which
stands and hears him, rejoiceth greatly because of the bridegroom's
voice: this my joy therefore is fulfilled. He must increase, but I
must decrease. He that cometh from above is above all: he that is of
the earth is earthly, and speaketh of the earth: he that cometh from
heaven is above all. And what he hath seen and heard, that he
testifieth; and no man receiveth his testimony. He that hath received
his testimony hath set to his seal that God is true. For he whom God
hath sent speaketh the words of God: for God giveth not the Spirit by
measure. The Father loveth the Son, and hath given all things into his
hand. He that believeth on the Son hath everlasting life: and he that
believeth not the Son shall not see life; but the wrath of God abideth
on him." John 3:28-35
John the Baptist's ministry was to prepare the way of the Lord, to point to Christ, to go before the promised Messiah to get ready those of his Jewish people who would then be prepared to respond to Christ in faith and thus be saved from the wrath of God. John's preaching is mentioned twice. The first preaching was in the wilderness. Then there was baptism in Jordan, with confession of sins. Note this point:
"Forgiveness of sins is not mentioned. Confession of sins is entailed
in receiving John's words and being baptised as a result. This baptism
was unto remission of sins. It, itself, is not the actual remission of
sins. Under John's ministry, sins are exposed; sins are admitted; sins
are confessed. No more... The baptism of John was administered only to
those who went out of Israel, Israelites, and attended his baptism in
Jordan... His preaching exposed conditions and his preaching heralded
the One who could answer those conditions." (The Beginning of the
Gospel, pp39-40, Nigel Johnstone, Belmont 2012)
John was the culmination of all the prophets who had gone before him, being the link from the old to the new. He had to preach repentance to prepare people to receive the Messiah, the Messenger of the Covenant. People had to confess their sins and be baptised in recognition that their sins were exposed. He came to turn people from darkness to the Light of the World, Jesus Christ (John 1:7). Those who turned to the Light John pointed to could then receive this Light and have the power to become the sons of God by being born again (John 1:12-13). What was this new birth and this repentance?
"Being born again necessitates a preparation by God Almighty himself,
by the words of the preparative messenger which he, himself,
authorises and sends. Receiving these words, there will be a cleansing
that will separate a soul and remove from that soul that which
prohibits the growth of the word within it. This, and this only, is
the beginning of the gospel." (Ibid. p 75)
"Repentance is to have the mind itself changed, not merely its
contents. Repentance is to have a different mind, with a different way
of working. The beginning of the gospel is the changed mind which
results from the ministry of a preparative messenger... When God gives
a man a new mind, in which he writes his laws; and a new heart, in
which he also writes his laws; then, in such a condition, after such a
baptism, is a man ready to receive the messenger of the covenant...
The ministry of John the Baptist, the preparative messenger, is a
ministry that prepares the heart and mind for the coming of Christ to
the soul, as conveyed in the gospel. It, itself, does not convey
Christ. It prepares for that event. And if the preparation is not
received, nor will Christ be received. (Ibid. pp 45-46)
The principle is the same for all who, throughout the centuries, will be saved. John's preaching was the beginning of the gospel. In Matthew 3:10, John was not preaching 'good works'! He was warning religious hypocrites that their unfruitful faithlessness, and their legalistic bad fruits would lead to them being chopped down very shortly. John's message had to be received and acted upon if anyone was to then discover Jesus Christ to be the Salvation of God. John was a voice of preparation, and he pointed to Christ for salvation.
Jesus submitted to John's baptism to authenticate John's preparatory ministry. Once that was done, all was fulfilled - Malachi 3 had happened, and thus the old covenant era was ended, John being its last herald. But the ministry of John the Baptist is relevant to every soul of man in all creation. He preached and baptized in the wilderness - representing the wilderness of the whole world. If a man exists, then John preaches to him, whether he will hear or not. This ministry of preparation shall continue to the end of time, wherever the Gospel shall be preached.
In Revelation chapter 14 an angel flies in mid-heaven "having the everlasting gospel to preach unto them that dwell on the earth, and to every nation, and kindred, and tongue, and people, Saying with a loud voice, Fear God, and give glory to him; for the hour of his judgment is come, and worship him that made heaven and earth and the sea and the fountains of waters" (vss 6-7).
The angel who flies in mid-heaven, before the risen Christ returns, commands everyone to do what we ought to do, not to do 'good works'! Everyone ought to fear God and give glory to him! But those who will not obey the beginning of the gospel will never obey the Christ who IS, in his person, that glorious means of salvation. Therefore, the beginning of the gospel, which John preached, was to confess our sins to God and repentantly turn to God's means of salvation - the Messiah. They will become part of the "bride of the bridegroom" - the one John, as friend of the bridegroom, pointed to.
Biblical repentance prepares us to receive God's only means of salvation, achieved through the finished work of Christ on the cross. True faith, that can be seen in works that truly glorify God and not ourselves, is a gift from God, so that it is all of God, and not of us.