Galatians speaks a lot about the promise, so it is important to have a background understanding of the promise it order to correctly understand what Paul is saying.
In Matthew 4:15-23, Jesus began his ministry with the Gospel message to repent for the Kingdom of God is at hand, which was a light to the nations, and God's law was how his audience knew what sin is (Romans 3:20), so repenting from our disobedience to it is a central part of the Gospel of the Kingdom, which is in accordance with Jesus being sent in fulfillment of the promise to bless us by turning us from our wickedness (Acts 3:25-26), which is the Gospel that was made known in advance to Abraham in accordance with the promise (Galatians 3:8), and which he spread to Gentiles in Haran in accordance with the promise (Genesis 12:1-5).
In Genesis 18:19, God knew Abraham that he might teach his children and those of his household to walk in His way by doing righteousness and justice that the Lord may bring to him all that He has promised. In Genesis 26:4-5, God will multiply Abraham's children as the stars in the heaven, to his children he will give all of these lands, and through His children all of the nations of the earth will be blessed because he heard God's voice and guarded His charge, His commandments, His statutes, and His laws. In Deuteronomy 30:16, if the children of Abraham will love God with all of their heart by walking in God's way in obedience to His commandments, statutes, and laws, then they will live and multiply and God will bless them in the land that they go to possess. So the promise was made to Abraham and brought about because he walked in God's way in obedience to His law, he taught his children and those of his household to do that in accordance with spreading the Gospel of the Kingdom that was made known in advance to him, and because they did that.
In John 8:39, Jesus said that if they were children of Abraham, then they would be doing the same works as him, and in Psalms 119:1-3, God's law is how the children of Abraham knew how to be blessed by walking in God's way, so the way that the children of Abraham are multiplied and are a blessing to the nations in accordance with inheriting the promise through faith is by turning the nations from their wickedness and teaching them to do the same works as Abraham by walking in God's way in obedience to His law in accordance with spreading the Gospel of the Kingdom.
In Acts 5:32, the Spirit has been given to those who obey God, so obedience to God is part of the way to receive the Spirit, however, Galatians 3:1-2 denies that "works of the law" are part of the way to receive the Spirit, therefore that phrase doesn't refer to obedience to God. In Romans 3:27, Paul contrasted a law of works with a law of faith, so works of the law are of works, while he said that our faith upholds God's law, so it is of faith, and a law that our faith upholds can't be referring to the same thing as the works of the law that are not of faith in Galatians 3:10-12.
According to Deuteronomy 27-28, relying on God's law is the way to be blessed while refusing to rely on it is the way to be cursed, so Galatians 3:10 should not be interpreted as quoting from those chapters in order to support a point that is arguing against them by saying that relying on it is the way to be cursed while refusing to rely on it is the way to avoid being cursed. Rather, the way to come under the curse of the God's law is by not relying on it, so everyone who relies on works of the law instead comes under that curse. Jesus setting us free from the curse of refusing to rely on God's law is setting us free to enjoy the blessing of relying on it.
In Galatians 3:10-12, Paul connected a quote from Habakkuk 2:4 saying that the righteous shall live by faith with a quote from Leviticus 18:5 that the one who obeys God's law will attain life by it, so the righteous who are living by faith are the same as those who are living in obedience to God's law. In addition, the context of Habakkuk 2 contrasts the righteous who are living by faith with those who are not living in obedience to God's law and in Isaiah 51:7, the righteous are those on whose heart is God's law, so the righteous living by faith does not refer to alternative manner of living that is not in obedience to it. God is trustworthy, therefore His law is also trustworthy (Psalms 19:7), so the way to trust God is by obediently trusting in His law, it is contradictory to think that we should trust God, but not His law, and to interpret that as saying that God's law is not of faith is to deny the trustworthiness of God.
In Galatians 3:16-19, a new covenant does not nullify the promise of a covenant that has already been ratified, so the New Covenant does not nullify our need to obey God's law in connection with the promise, but rather it involves God putting His law in our minds and writing it on our hearts (Jeremiah 31:33). Likewise, in Galatians 3:26-29, every aspect of being children of God, through faith, in Christ, and children of Abraham and heirs to the promise is directly connected with living in obedience to God's law. In 1 John 3:4-10, those who do not practice righteousness in obedience to God's law are not children of God, in Matthew 23:23, Jesus said that faith is one of the weightier matters of God's law, and in 1 John 2:6, those who are in Christ are obligated to walk in the same way he walked.
If God saved the Israelites out of slavery in Egypt in order to put them under slavery to His law, then it would be for slavery that God set us free, however, Galatians 5:1 says that it is for freedom that God set us free. Moreover, God's law in connection with the promise came through the line of the free woman, not the line of the slave woman.