Galatians 3:[1] O foolish Galatians, who hath bewitched you, that ye should not obey the truth, before whose eyes Jesus Christ hath been evidently set forth, crucified among you?
[2] This only would I learn of you, Received ye the Spirit by the works of the law, or by the hearing of faith?
Paul had preached the gospel throughout Galatia after the conference of Acts 15 where the topic of Gentiles and law was discussed. In particular the Jews expressing a necessity for the Gentile believers to be circumcised. (Acts.15:[1] And certain men which came down from Judaea taught the brethren, and said, Except ye be circumcised after the manner of Moses, ye cannot be saved.
[2] When therefore Paul and Barnabas had no small dissension and disputation with them, they determined that Paul and Barnabas, and certain other of them, should go up to Jerusalem unto the apostles and elders about this question.)

As Paul had preached in Corinth (1Cor.2:[1] And I, brethren, when I came to you, came not with excellency of speech or of wisdom, declaring unto you the testimony of God.
[2] For I determined not to know any thing among you, save Jesus Christ, and him crucified.)
He so preached plainly the simplicity of the gospel. So plainly it was as if Christ had been crucified in their presence. He did not come to them preaching circumcision or works but faith in the finished work of Jesus Christ (death, burial, resurrection) They, as we all who have put our trust in Christ, received the sealing of the Holy Spirit (spiritual circumcision) after acceptance of the gospel.
This showing evidence the Holy Spirit enters in with the accepting of the gospel and not some “second blessing” but at the moment of conversion.

[3] Are ye so foolish? having begun in the Spirit, are ye now made perfect by the flesh?
[4] Have ye suffered so many things in vain? if it be yet in vain.

They received the Spirit at the beginning not some time later and not received by some but all received at the time they believed. The simplicity of the gospel saves us with no assistance from us. (Titus 3:4-7) We do not work for our salvation neither do we work to maintain it. We do not work to get to Heaven . What good works we do shows evidence we are going to Heaven.
They had evidently already suffered some persecution for having not been circumcised, the Apostle states then if you were supposed to have followed the law you must have suffered for naught. But the Apostle is about to show they indeed did not suffer for nothing but suffered rightly because we as Christians are not required to put ourselves under the law.

[5] He therefore that ministereth to you the Spirit, and worketh miracles among you, doeth he it by the works of the law, or by the hearing of faith?

Proof one: the Lord ministers to them through the teaching of the gospel and not that of the law. The law did not save them nor give them the new birth. Neither entered in the Spirit through teaching of the law or by being physically circumcised but by the preaching of the gospel of faith.

[6] Even as Abraham believed God, and it was accounted to him for righteousness.
[7] Know ye therefore that they which are of faith, the same are the children of Abraham.

Proof two: Abraham being the example of those who simply believes and accepts what God tells them as a means of receiving God’s righteousness and not their own works of righteousness.
Not only did Abraham receive the blessing of righteousness through belief but so do we all become heirs of God’s righteousness through believing. (Rom.4:[1] What shall we say then that Abraham our father, as pertaining to the flesh, hath found?
[2] For if Abraham were justified by works, he hath whereof to glory; but not before God.
[3] For what saith the scripture? Abraham believed God, and it was counted unto him for righteousness.
[4] Now to him that worketh is the reward not reckoned of grace, but of debt.
[5] But to him that worketh not, but believeth on him that justifieth the ungodly, his faith is counted for righteousness.
[6] Even as David also describeth the blessedness of the man, unto whom God imputeth righteousness without works,
[7] Saying, Blessed are they whose iniquities are forgiven, and whose sins are covered.
[8] Blessed is the man to whom the Lord will not impute sin.
[9] Cometh this blessedness then upon the circumcision only, or upon the uncircumcision also? for we say that faith was reckoned to Abraham for righteousness.
[10] How was it then reckoned? when he was in circumcision, or in uncircumcision? Not in circumcision, but in uncircumcision.
[11] And he received the sign of circumcision, a seal of the righteousness of the faith which he had yet being uncircumcised: that he might be the father of all them that believe, though they be not circumcised; that righteousness might be imputed unto them also:
[12] And the father of circumcision to them who are not of the circumcision only, but who also walk in the steps of that faith of our father Abraham, which he had being yet uncircumcised.
[13] For the promise, that he should be the heir of the world, was not to Abraham, or to his seed, through the law, but through the righteousness of faith.
[14] For if they which are of the law be heirs, faith is made void, and the promise made of none effect:
[15] Because the law worketh wrath: for where no law is, there is no transgression.
[16] Therefore it is of faith, that it might be by grace; to the end the promise might be sure to all the seed; not to that only which is of the law, but to that also which is of the faith of Abraham; who is the father of us all,)

[8] And the scripture, foreseeing that God would justify the heathen through faith, preached before the gospel unto Abraham, saying, In thee shall all nations be blessed.
[9] So then they which be of faith are blessed with faithful Abraham.

The giving of God’s Son on the cross being typified by the offering of Isaac by Abraham, bestowed upon us this same blessing of receiving righteousness by believing the work God has done for us. We receiving the blessing of the Holy Spirit, being spiritually circumcised, and the new birth through the cross . We being Gentiles not following neither knowing the law received the sealing of the Holy Spirit and becoming a child of God.

[10] For as many as are of the works of the law are under the curse: for it is written, Cursed is every one that continueth not in all things which are written in the book of the law to do them.
[11] But that no man is justified by the law in the sight of God, it is evident: for, The just shall live by faith.
[12] And the law is not of faith: but, The man that doeth them shall live in them.
[13] Christ hath redeemed us from the curse of the law, being made a curse for us: for it is written, Cursed is every one that hangeth on a tree:
[14] That the blessing of Abraham might come on the Gentiles through Jesus Christ; that we might receive the promise of the Spirit through faith.

Here the Apostle quotes from Deuteronomy 27:26 showing if we are to follow the law we must indeed follow ALL of the law not just the part of circumcision of the flesh. But the Word in Habakkuk 2:4 is the just man must live by his faith. Our faith is not one of the law but the preaching of the cross. We being made free by Jesus receiving the curse for us on the cross. The Apostle quoting from Deuteronomy 21:23 showing Jesus had indeed received the curse from God for us by hanging on a tree. So then we being born of the Spirit have been made to receive the blessing of children through faith.

[15] Brethren, I speak after the manner of men; Though it be but a man’s covenant, yet if it be confirmed, no man disannulleth, or addeth thereto.
[16] Now to Abraham and his seed were the promises made. He saith not, And to seeds, as of many; but as of one, And to thy seed, which is Christ.
[17] And this I say, that the covenant, that was confirmed before of God in Christ, the law, which was four hundred and thirty years after, cannot disannul, that it should make the promise of none effect.
[18] For if the inheritance be of the law, it is no more of promise: but God gave it to Abraham by promise.

Now calling them “brethren” indicating the relationship through the blood of Christ. Us Gentiles in verse 14 now brethren through faith. The promise of all of the nations being blessed and the promise of inheritance to Abraham was made some 430 years before the law was given to the children of Israel. The law like any other covenant is only binding on those in the covenant agreement. If I make a contract with a finance company to finance my vehicle it is not binding on other parties but strictly an agreement between myself and the finance company. The terms being set in the contract and in legal force until the obligations of the terms are met. The blessing was promised to Abraham and Jesus Christ (His seed as the same seed promised to Eve in Genesis) without the conditions imposed by the law some 430 years later.)

[19] Wherefore then serveth the law? It was added because of transgressions, till the seed should come to whom the promise was made; and it was ordained by angels in the hand of a mediator.
[20] Now a mediator is not a mediator of one, but God is one.

The law was given as a means of showing the sinfulness of sin and as a means of control over the behavior of man. Once Jesus (the seed) came and met the terms of the contract the contract was complete. The debt of sin had been paid in full.
A mediator is one who intervenes between two parties in an attempt to bring about reconciliation between the two. Jesus, who is God, acted as our Mediator. Which is to say, God mediated between man and Himself.
{Not to be overlooked is the statement “ordained by angels”. An examination of a few references gives the information that God used His angels in the giving of the law. NOTE the following passages.:
Heb.2:[1] Therefore we ought to give the more earnest heed to the things which we have heard, lest at any time we should let them slip.[2] For if the word spoken by angels was stedfast, and every transgression and disobedience received a just recompence of reward;

Acts 7:[51] Ye stiffnecked and uncircumcised in heart and ears, ye do always resist the Holy Ghost: as your fathers did, so do ye.
[52] Which of the prophets have not your fathers persecuted? and they have slain them which shewed before of the coming of the Just One; of whom ye have been now the betrayers and murderers:
[53] Who have received the law by the disposition of angels, and have not kept it.

Deut.33:[1] And this is the blessing, wherewith Moses the man of God blessed the children of Israel before his death.
[2] And he said, The LORD came from Sinai, and rose up from Seir unto them; he shined forth from mount Paran, and he came with ten thousands of saints: from his right hand went a fiery law for them.
[3] Yea, he loved the people; all his saints are in thy hand: and they sat down at thy feet; every one shall receive of thy words.}

[21] Is the law then against the promises of God? God forbid: for if there had been a law given which could have given life, verily righteousness should have been by the law.

No following of the law could breed a new birth. The inside of man remained dead (the spiritual internal death experienced by Adam when he partook of the fruit) until the coming of the Spirit brought the new birth.
[22] But the scripture hath concluded all under sin, that the promise by faith of Jesus Christ might be given to them that believe.
[23] But before faith came, we were kept under the law, shut up unto the faith which should afterwards be revealed.
[24] Wherefore the law was our schoolmaster to bring us unto Christ, that we might be justified by faith.

The law prophesied until the ministry of John the Baptist began.
(Mathew 11:[13] For all the prophets and the law prophesied until John.) From there the kingdom gospel began. The law had brought mankind, in particular, the children of Israel to that point. Then Christ began His ministry. The rejection of Jesus and crucifixion sealing temporarily the fate of the nation and opening the door through faith to the entire world.

[25] But after that faith is come, we are no longer under a schoolmaster.
[26] For ye are all the children of God by faith in Christ Jesus.
[27] For as many of you as have been baptized into Christ have put on Christ.
[28] There is neither Jew nor Greek, there is neither bond nor free, there is neither male nor female: for ye are all one in Christ Jesus.
[29] And if ye be Christ’s, then are ye Abraham’s seed, and heirs according to the promise.

Through the new birth and spiritual circumcision performed by the Holy Spirit all who believe Jew and Gentile alike become the children of God through faith.
Titus 3:[4] But after that the kindness and love of God our Saviour toward man appeared,
[5] Not by works of righteousness which we have done, but according to his mercy he saved us, by the washing of regeneration, and renewing of the Holy Ghost;
[6] Which he shed on us abundantly through Jesus Christ our Saviour;
[7] That being justified by his grace, we should be made heirs according to the hope of eternal life.